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

Commit

Permalink
remove incorrect comment
Browse files Browse the repository at this point in the history
- both Thread.remove and thread_suspendAll synchronize on slock
  so a double removal isn't possible
- we still set isRunning to false b/c some functions must not be called
  on a stopped thread, e.g. setPriority
  • Loading branch information
MartinNowak committed Oct 31, 2015
1 parent 1c95b58 commit 8287001
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/core/thread.d
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,8 @@ else version( Posix )
//Thread.add( obj );
scope( exit )
{
// NOTE: isRunning should be set to false after the thread is
// removed or a double-removal could occur between this
// function and thread_suspendAll.
Thread.remove( obj );
atomicStore!(MemoryOrder.raw)(obj.m_isRunning,false);
atomicStore!(MemoryOrder.raw)(obj.m_isRunning, false);
}
Thread.add( &obj.m_main );

Expand Down Expand Up @@ -2012,6 +2009,7 @@ extern (C) void thread_init()
*/
extern (C) void thread_term()
{
assert(Thread.sm_tbeg && Thread.sm_tlen == 1);
Thread.termLocks();

version( OSX )
Expand Down

0 comments on commit 8287001

Please sign in to comment.