aboutsummaryrefslogtreecommitdiff
path: root/src/unittest/test_threading.cpp
AgeCommit message (Collapse)Author
2020-09-10Remove Thread::kill() and related unittest (#10317)Sebastien Marie
Closes: #6065
2017-08-19Code modernization: subfolders (#6283)Loïc Blot
* Code modernization: subfolders Modernize various code on subfolders client, network, script, threading, unittests, util * empty function * default constructor/destructor * for range-based loops * use emplace_back instead of push_back * C++ STL header style * Make connection.cpp readable in a pointed place + typo
2017-06-06C++11 patchset 3: remove Atomic/GenericAtomic and use std::atomic (#5906)Loïc Blot
2017-01-28Fix synchronization issue at thread startShadowNinja
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.
2016-10-06Travis: build matrix improvements + CPP11 buildLoic Blot
2016-07-04Temporarily disable "testStartStopWait" Threading unit test on macest31
The "testStartStopWait" unit test is unreliably failing on mac, for some time already. See bug #3786. Having the unittest fail unreliably doesn't help anybody but mostly inhibits the main feature of travis builds: to test PRs for regressions. Therefore, disable the specific unit test for until bug #3786 is fixed.
2015-10-24Fix some threading things and add additional thread unittestskwolekr
- Fix thread name reset on start() - Fully reset thread state on kill() - Add unittests to check for correct object states under various circumstances
2015-08-23Clean up threadingShadowNinja
* Rename everything. * Strip J prefix. * Change UpperCamelCase functions to lowerCamelCase. * Remove global (!) semaphore count mutex on OSX. * Remove semaphore count getter (unused, unsafe, depended on internal API functions on Windows, and used a hack on OSX). * Add `Atomic<type>`. * Make `Thread` handle thread names. * Add support for C++11 multi-threading. * Combine pthread and win32 sources. * Remove `ThreadStarted` (unused, unneeded). * Move some includes from the headers to the sources. * Move all of `Event` into its header (allows inlining with no new includes). * Make `Event` use `Semaphore` (except on Windows). * Move some porting functions into `Thread`. * Integrate logging with `Thread`. * Add threading test.