Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

[stable] Allow detached threads to be joined on Windows too #3429

Merged
merged 1 commit into from
Apr 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core/thread/osthread.d
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ class Thread : ThreadBase
{
version (Windows)
{
if ( WaitForSingleObject( m_hndl, INFINITE ) != WAIT_OBJECT_0 )
if ( m_addr != m_addr.init && WaitForSingleObject( m_hndl, INFINITE ) != WAIT_OBJECT_0 )
throw new ThreadException( "Unable to join thread" );
// NOTE: m_addr must be cleared before m_hndl is closed to avoid
// a race condition with isRunning. The operation is done
Expand Down