diff options
| author | Andy Wingo <wingo@pobox.com> | 2017-02-20 20:25:12 +0100 |
|---|---|---|
| committer | Andy Wingo <wingo@pobox.com> | 2017-02-20 20:25:12 +0100 |
| commit | a1ac11aaf3484796ec223afeb8d6c273c6045f17 (patch) | |
| tree | 2d46f04d5b2c71b448128c2f91760ca2469e0261 | |
| parent | Update (web server fibers) (diff) | |
| download | guile-fibers-a1ac11aaf3484796ec223afeb8d6c273c6045f17.tar.gz | |
Add block-asyncs in fiber->thread resume path
* fibers/operations.scm (perform-operation): Block asyncs in resume
callback; otherwise the fiber doing the resuming could be scheduled
away.
| -rw-r--r-- | fibers/operations.scm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/fibers/operations.scm b/fibers/operations.scm index 0008d3a..ef2969c 100644 --- a/fibers/operations.scm +++ b/fibers/operations.scm @@ -165,10 +165,12 @@ the operation cannot complete directly, block until it can complete." ((eq? (current-thread) thread) (set! k thunk)) (else - (lock-mutex mutex) - (set! k thunk) - (signal-condition-variable condvar) - (unlock-mutex mutex)))) + (call-with-blocked-asyncs + (lambda () + (lock-mutex mutex) + (set! k thunk) + (signal-condition-variable condvar) + (unlock-mutex mutex)))))) (lock-mutex mutex) (block #f resume) (let lp () |
