Opened 11 years ago
Closed 11 years ago
#5842 closed Bugs (invalid)
thread.cpp: Win32 thread::thread() calls GetCurrentThread, which returns a pseudo-handle
Reported by: | Owned by: | viboes | |
---|---|---|---|
Milestone: | To Be Determined | Component: | thread |
Version: | Boost 1.47.0 | Severity: | Problem |
Keywords: | Cc: |
Description
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
Change History (4)
comment:1 by , 11 years ago
Component: | None → thread |
---|---|
Owner: | set to |
comment:2 by , 11 years ago
comment:3 by , 11 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Type: | Bugs → Support Requests |
Moved to support request until resolution clarified.
comment:4 by , 11 years ago
Resolution: | → invalid |
---|---|
Status: | assigned → closed |
Type: | Support Requests → Bugs |
It seems that this pseudo-handle is not used by other threads, so no need to duplicate.
Please, reopen it if you don't agree with the resolution.
Note:
See TracTickets
for help on using tickets.
Are you sure that this pseudo handle is used by another thread?
BTW, thanks for all your reports. This will help a lot to make Boost.Thread more robust :)