Synchronizing native cross-platform threads