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

Commit

Permalink
Merge pull request #1016 from rainers/unittest_thread_detach
Browse files Browse the repository at this point in the history
Fix unittest in core.thread
  • Loading branch information
MartinNowak committed Nov 11, 2014
2 parents d306681 + 91c880f commit 374bd4f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/thread.d
Original file line number Diff line number Diff line change
Expand Up @@ -2142,10 +2142,16 @@ extern (C) void thread_detachInstance( Thread t )

unittest
{
import core.sync.semaphore;
auto sem = new Semaphore();

auto t = new Thread(
{
sem.notify();
Thread.sleep(100.msecs);
}).start();

sem.wait(); // thread cannot be detached while being started
thread_detachInstance(t);
foreach (t2; Thread)
assert(t !is t2);
Expand Down

0 comments on commit 374bd4f

Please sign in to comment.