[Boost-bugs] [Boost C++ Libraries] #5842: thread.cpp: Win32 thread::thread() calls GetCurrentThread, which returns a pseudo-handle

Subject: [Boost-bugs] [Boost C++ Libraries] #5842: thread.cpp: Win32 thread::thread() calls GetCurrentThread, which returns a pseudo-handle
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-08-30 07:23:30


#5842: thread.cpp: Win32 thread::thread() calls GetCurrentThread, which returns a
pseudo-handle
--------------------------------+-------------------------------------------
 Reporter: noloader@… | Owner:
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: None
  Version: Boost 1.47.0 | Severity: Problem
 Keywords: |
--------------------------------+-------------------------------------------
 GetCurrentThread() returns a pseudo-handle. All threads which call it are
 returned a value of (HANDLE)-2 (if I recall correctly). To get a 'real'
 handle, use DuplicateHandle() [1].

 {{{
 thread::thread() : m_joinable(false)
 {
   m_thread = reinterpret_cast<void*>(GetCurrentThread());
   m_id = GetCurrentThreadId();
 }
 }}}

 [1] http://msdn.microsoft.com/en-us/library/ms683182(v=vs.85).aspx

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5842>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:07 UTC