std::call_once without TLS

Jonathan Wakely jwakely.gcc@gmail.com
Thu Apr 23 10:55:00 GMT 2009


2009/4/4 Jonathan Wakely:
>> A build with --disable-tls causes this new test to fail in
>> unique_lock::lock() when a second thread tries to lock the global
>> mutex that is already locked.
>>
>> Tested x86-64-unknown-linux-gnu with --disable-tls, ok for trunk and 4.4?


Patch updated for current trunk and retested. OK for trunk?

        * include/std/mutex (__get_once_functor_lock, __get_once_mutex):
        Replace global lock object with local locks on global mutex.
        * src/mutex.cc: Likewise.
        * config/abi/pre/gnu.ver: Adjust.
        * testsuite/30_threads/call_once/call_once2.cc: New.

Jonathan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: once4.patch
Type: text/x-patch
Size: 4707 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20090423/890360a0/attachment.bin>


More information about the Libstdc++ mailing list