There is C++ thread support added by @komh in 203e99b9081c6951f5ac88bb6b950ac9ec779e21. However, __gthread_create and other functions dealing with shared thread data (like the thread list) are not thread-safe. This means that if two threads call __gthread_create (i.e. instantiate an std::thread object) at the same time, data corruption is likely to occur.
We should make this interface thread-safe. One way to do so is to use the Posix code, i.e. switch to using our PTHREAD library (whose pthread_create and other APIs are already thread-safe). This has also a benefit of bringing pthread key destructor support to all C++ threads (see https://github.com/bitwiseworks/pthread-os2/issues/1).
There is C++ thread support added by @komh in 203e99b9081c6951f5ac88bb6b950ac9ec779e21. However,
__gthread_create
and other functions dealing with shared thread data (like the thread list) are not thread-safe. This means that if two threads call__gthread_create
(i.e. instantiate anstd::thread object
) at the same time, data corruption is likely to occur.We should make this interface thread-safe. One way to do so is to use the Posix code, i.e. switch to using our PTHREAD library (whose
pthread_create
and other APIs are already thread-safe). This has also a benefit of bringing pthread key destructor support to all C++ threads (see https://github.com/bitwiseworks/pthread-os2/issues/1).See also https://github.com/bitwiseworks/pthread-os2/issues/2#issuecomment-603811814.