File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -74,13 +74,13 @@ namespace rubinius {
7474 }
7575
7676 void Fiber::restart (STATE) {
77- if (!vm ()->suspended_p ()) {
78- Exception::raise_fiber_error (state, " attempt to restart non-suspended fiber" );
79- }
80-
8177 {
8278 std::lock_guard<std::mutex> guard (state->vm ()->thread ()->fiber_mutex ());
8379
80+ if (!vm ()->suspended_p ()) {
81+ Exception::raise_fiber_error (state, " attempt to restart non-suspended fiber" );
82+ }
83+
8484 while (vm ()->suspended_p ()) {
8585 std::lock_guard<std::mutex> guard (vm ()->wait_mutex ());
8686 vm ()->wait_condition ().notify_one ();
@@ -93,7 +93,10 @@ namespace rubinius {
9393 ; // spin wait
9494 }
9595
96- state->vm ()->thread ()->current_fiber (state, this );
96+ {
97+ std::lock_guard<std::mutex> guard (state->vm ()->thread ()->fiber_mutex ());
98+ state->vm ()->thread ()->current_fiber (state, this );
99+ }
97100 }
98101
99102 void Fiber::suspend (STATE) {
You can’t perform that action at this time.
0 commit comments