2
0
mirror of https://github.com/boostorg/fiber.git synced 2026-02-02 08:52:07 +00:00

remove wake_up/woke_up -> use of is_ready/set_ready instead

This commit is contained in:
Oliver Kowalke
2013-02-17 17:40:08 +01:00
parent 512a0a1ecb
commit 68615292d2
8 changed files with 29 additions and 35 deletions

View File

@@ -36,7 +36,7 @@ mutex::~mutex()
void
mutex::lock()
{
if ( LOCKED == state_.exchange( LOCKED, memory_order_seq_cst) )
while ( LOCKED == state_.exchange( LOCKED, memory_order_seq_cst) )
{
detail::notify::ptr_t n( detail::scheduler::instance().active() );
try
@@ -59,7 +59,7 @@ mutex::lock()
waiting_.push_back( n);
lk.unlock();
while ( ! n->woken_up() )
while ( ! n->is_ready() )
{
fprintf(stdout, "mutex: main-fiber not woken-up\n");
// run scheduler
@@ -98,7 +98,7 @@ mutex::unlock()
state_ = UNLOCKED;
if ( n)
n->wake_up();
n->set_ready();
}
}}