Sign in
chromium
/
external
/
github.com
/
kripken
/
emscripten
/
HEAD
/
.
/
test
/
pthread
/
test_pthread_busy_wait.cpp
blob: 391239d61db1c5877679638e7fd039667db3a1b2 [
file
]
#include
<atomic>
#include
<thread>
#include
<cstdio>
int
main
()
{
std
::
atomic
<bool>
done
(
false
);
std
::
thread t
([&]{
printf
(
"in thread\n"
);
done
=
true
;
});
while
(!
done
)
{
std
::
this_thread
::
yield
();
}
t
.
join
();
printf
(
"done\n"
);
return
0
;
}