2
0
mirror of https://github.com/boostorg/fiber.git synced 2026-02-14 12:42:28 +00:00

mutex' call lk.unlock() instead splk_.unlock()

This commit is contained in:
Oliver Kowalke
2013-10-18 20:29:18 +02:00
parent bc4478c599
commit bdbe2ea1f7
4 changed files with 22 additions and 22 deletions

View File

@@ -56,7 +56,7 @@ recursive_timed_mutex::lock()
unique_lock< detail::spinlock > lk( splk_);
// store this fiber in order to be notified later
waiting_.push_back( n);
splk_.unlock();
lk.unlock();
// suspend this fiber
detail::scheduler::instance()->wait();
@@ -70,7 +70,7 @@ recursive_timed_mutex::lock()
unique_lock< detail::spinlock > lk( splk_);
// store this fiber in order to be notified later
waiting_.push_back( n);
splk_.unlock();
lk.unlock();
// wait until main-fiber gets notified
while ( ! n->is_ready() )
@@ -132,7 +132,7 @@ recursive_timed_mutex::try_lock_until( clock_type::time_point const& timeout_tim
unique_lock< detail::spinlock > lk( splk_);
// store this fiber in order to be notified later
waiting_.push_back( n);
splk_.unlock();
lk.unlock();
// suspend this fiber until notified or timed-out
if ( ! detail::scheduler::instance()->wait_until( timeout_time) ) {
@@ -140,7 +140,7 @@ recursive_timed_mutex::try_lock_until( clock_type::time_point const& timeout_tim
// remove fiber from waiting-list
waiting_.erase(
std::find( waiting_.begin(), waiting_.end(), n) );
splk_.unlock();
lk.unlock();
return false;
}
}
@@ -153,7 +153,7 @@ recursive_timed_mutex::try_lock_until( clock_type::time_point const& timeout_tim
unique_lock< detail::spinlock > lk( splk_);
// store this fiber in order to be notified later
waiting_.push_back( n);
splk_.unlock();
lk.unlock();
// wait until main-fiber gets notified
while ( ! n->is_ready() )
@@ -164,7 +164,7 @@ recursive_timed_mutex::try_lock_until( clock_type::time_point const& timeout_tim
// remove fiber from waiting-list
waiting_.erase(
std::find( waiting_.begin(), waiting_.end(), n) );
splk_.unlock();
lk.unlock();
return false;
}
// run scheduler
@@ -178,7 +178,7 @@ recursive_timed_mutex::try_lock_until( clock_type::time_point const& timeout_tim
// remove fiber from waiting-list
waiting_.erase(
std::find( waiting_.begin(), waiting_.end(), n) );
splk_.unlock();
lk.unlock();
throw;
}
}
@@ -209,7 +209,7 @@ recursive_timed_mutex::unlock()
n.swap( waiting_.front() );
waiting_.pop_front();
}
splk_.unlock();
lk.unlock();
owner_ = detail::fiber_base::id();
state_ = UNLOCKED;