repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Fix compilation of server.cc on hpux.
[official-gcc.git]
/
libphobos
/
testsuite
/
libphobos.thread
/
join_detach.d
blob
f1515190171f022ec170bb159b077cd614ac4168
1
import
core
.
thread
;
2
import
core
.
sync
.
semaphore
;
3
4
__gshared Semaphore sem
;
5
6
void
thread_main
()
7
{
8
sem
.
notify
();
9
}
10
11
void
main
()
12
{
13
auto
th
=
new
Thread
(&
thread_main
);
14
sem
=
new
Semaphore
();
15
th
.
start
();
16
sem
.
wait
();
17
while
(
th
.
isRunning
()) {}
18
destroy
(
th
);
// force detach
19
th
.
join
();
20
}