From baa2828df6acdbfe6bf47e727de11573052a0937 Mon Sep 17 00:00:00 2001 From: Oliver Kowalke Date: Sun, 29 Dec 2013 21:03:26 +0100 Subject: [PATCH] move re-locking of external lock in branch --- include/boost/fiber/condition.hpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/include/boost/fiber/condition.hpp b/include/boost/fiber/condition.hpp index 64b89e25..9ae03f97 100644 --- a/include/boost/fiber/condition.hpp +++ b/include/boost/fiber/condition.hpp @@ -96,6 +96,9 @@ public: // this fiber was notified and resumed // check if fiber was interrupted this_fiber::interruption_point(); + + // lock external again before returning + lt.lock(); } else { @@ -120,6 +123,9 @@ public: while ( ! n->is_ready() ) // run scheduler detail::scheduler::instance()->run(); + + // lock external again before returning + lt.lock(); } } catch (...) @@ -130,9 +136,6 @@ public: std::find( waiting_.begin(), waiting_.end(), n) ); throw; } - - // lock external again before returning - lt.lock(); } template< typename LockType > @@ -172,6 +175,9 @@ public: // check if fiber was interrupted this_fiber::interruption_point(); + + // lock external again before returning + lt.lock(); } else { @@ -210,6 +216,9 @@ public: // run scheduler detail::scheduler::instance()->run(); } + + // lock external again before returning + lt.lock(); } } catch (...) @@ -221,9 +230,6 @@ public: throw; } - // lock external again before returning - lt.lock(); - return status; }