minetest/src/unittest
ShadowNinja c93f7f5cea Fix synchronization issue at thread start
If a newly spawned thread called getThreadId or getThreadHandle before
the spawning thread finished saving the thread handle, then the
handle/id would be used uninitialized.  This would cause the threading
tests to fail since isCurrentThread would return false, and if Minetest
is built with C++11 support the std::thread object pointer would be
dereferenced while ininitialized, causing a segmentation fault.

This fixes the issue by using a mutex to force the spawned thread to
wait for the spawning thread to finish initializing the thread object.

An alternative way to handle this would be to also set the thread
handle/id in the started thread but this wouldn't work for C++11
builds because there's no way to get the partially constructed object.
2017-01-28 18:52:07 -05:00
..
CMakeLists.txt Add unittests to test player saving/loading (#4679) 2016-10-27 09:45:01 +02:00
test.cpp Remove some abort() calls 2015-10-26 04:45:00 +01:00
test.h Remove some abort() calls 2015-10-26 04:45:00 +01:00
test_areastore.cpp Implement AreaStore serialization 2016-03-07 16:33:20 -05:00
test_collision.cpp Don't pass non-const references to collision methods 2016-01-29 15:53:54 +01:00
test_compression.cpp Tests: Modularize unit testing 2015-04-26 15:08:54 -04:00
test_connection.cpp Tests: Modularize unit testing 2015-04-26 15:08:54 -04:00
test_filepath.cpp Fix RemoveRelatvePathComponents 2016-12-20 17:17:38 +10:00
test_inventory.cpp Tests: Modularize unit testing 2015-04-26 15:08:54 -04:00
test_keycode.cpp Add keycode.cpp unittests 2016-09-25 17:26:38 +02:00
test_map_settings_manager.cpp couple of memory leaks fixes. 2016-08-10 16:59:32 +02:00
test_mapnode.cpp Remove unused functions. 2015-08-16 14:29:33 +02:00
test_nodedef.cpp Tests: Modularize unit testing 2015-04-26 15:08:54 -04:00
test_noderesolver.cpp NodeResolver: Remove NodeResolveMethod 2015-05-07 02:36:01 -04:00
test_noise.cpp Tests: Modularize unit testing 2015-04-26 15:08:54 -04:00
test_objdef.cpp Split ObjDef/ObjDefManager out to objdef.cpp 2015-05-18 22:30:25 -04:00
test_player.cpp Breath cheat fix: server side 2017-01-01 23:11:26 +01:00
test_profiler.cpp Tests: Modularize unit testing 2015-04-26 15:08:54 -04:00
test_random.cpp Fix Lua PcgRandom 2015-08-12 11:36:22 +02:00
test_schematic.cpp Add -Wsign-compare for Clang builds and fix some signed/unsigned compiler warnings 2015-05-16 20:15:03 -04:00
test_serialization.cpp Add BufReader and vector-based serialization methods 2015-10-15 01:31:31 -04:00
test_settings.cpp Travis: build matrix improvements + CPP11 build 2016-10-06 00:28:24 +02:00
test_socket.cpp Tests: Modularize unit testing 2015-04-26 15:08:54 -04:00
test_threading.cpp Fix synchronization issue at thread start 2017-01-28 18:52:07 -05:00
test_utilities.cpp Revert "Extend minetest.is_yes()" 2017-01-07 11:05:05 +01:00
test_voxelalgorithms.cpp Improve getPointedThing() (#4346) 2017-01-04 19:18:40 +01:00
test_voxelmanipulator.cpp Tests: Add NodeResolver unittests 2015-05-05 12:00:36 -04:00