diff --git a/core/threads/threads.factor b/core/threads/threads.factor index 0eecc70a27..23b1f04364 100755 --- a/core/threads/threads.factor +++ b/core/threads/threads.factor @@ -77,6 +77,9 @@ PRIVATE> : resume ( thread -- ) check-registered run-queue push-front ; +: resume-now ( thread -- ) + check-registered run-queue push-back ; + : resume-with ( obj thread -- ) check-registered 2array run-queue push-front ; diff --git a/extra/benchmark/ring/ring.factor b/extra/benchmark/ring/ring.factor index f1b7d6c9cc..ae918b7ebc 100755 --- a/extra/benchmark/ring/ring.factor +++ b/extra/benchmark/ring/ring.factor @@ -8,7 +8,9 @@ SYMBOL: done receive 2dup swap send done eq? [ tunnel ] unless ; : create-ring ( processes -- target ) - self swap [ [ tunnel ] "Tunnel" spawn nip ] times ; + self swap [ + dup [ tunnel ] curry "Tunnel" spawn nip + ] times ; : send-messages ( messages target -- ) dupd [ send ] curry each [ receive drop ] times ; diff --git a/extra/concurrency/conditions/conditions.factor b/extra/concurrency/conditions/conditions.factor index 4662f1b369..8126900dbc 100755 --- a/extra/concurrency/conditions/conditions.factor +++ b/extra/concurrency/conditions/conditions.factor @@ -4,10 +4,11 @@ USING: dlists threads kernel arrays sequences ; IN: concurrency.conditions : notify-1 ( dlist -- ) - dup dlist-empty? [ drop ] [ pop-back second resume ] if ; + dup dlist-empty? + [ drop ] [ pop-back second resume-now ] if ; : notify-all ( dlist -- ) - [ second resume ] dlist-slurp yield ; + [ second resume-now ] dlist-slurp yield ; : wait ( queue timeout status -- ) >r [ 2array swap push-front ] r> suspend 3drop ; inline