[c++0x] std::thread fixes

Jonathan Wakely jwakely.gcc@gmail.com
Thu Jan 22 23:32:00 GMT 2009

2009/1/22 Benjamin Kosnik:
> This is ok: please check it in.

Done. Here's the second part.

        * include/std/thread: Remove unused headers.
        (__thread_data_base): Remove unused mutex and base.
        (thread::~thread): Only detach if joinable.
        (thread::joinable): Test if thread data ptr is empty.
        (thread::_M_thread_data_mutex): Remove.
        (thread::_M_get_thread_data): Remove.
        (thread::_M_make_thread_data): Remove overload, use make_shared.
        (thread::id::id): Make constructor explicit.
        * src/thread.cc (thread::join,thread::detach): Throw if not joinable.
        (thread::_M_start_thread): Break shared_ptr cycle on error.
        (__thread_proxy): Use shared_ptr swap instead of copy and reset.
        * testsuite/30_threads/thread/member/4.cc: New.
        * testsuite/30_threads/thread/member/5.cc: New.

tested x86_64 linux
-------------- next part --------------
A non-text attachment was scrubbed...
Name: thread4.patch
Type: text/x-patch
Size: 9979 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20090122/f4e901c6/attachment.bin>

More information about the Gcc-patches mailing list