diff --git a/basis/timers/timers-tests.factor b/basis/timers/timers-tests.factor index 35f8483dcf..5abb0023e0 100644 --- a/basis/timers/timers-tests.factor +++ b/basis/timers/timers-tests.factor @@ -64,3 +64,12 @@ threads tools.test tools.time ; 700 milliseconds sleep dup restart-timer 700 milliseconds sleep stop-timer 500 milliseconds sleep ] unit-test + +{ { 2 } } [ + { 0 } + dup '[ 0 _ [ 1 + ] change-nth ] 300 milliseconds f + dup restart-timer + 700 milliseconds sleep + dup restart-timer drop + 700 milliseconds sleep +] unit-test diff --git a/basis/timers/timers.factor b/basis/timers/timers.factor index cbe9870573..925fc246a7 100644 --- a/basis/timers/timers.factor +++ b/basis/timers/timers.factor @@ -94,11 +94,10 @@ PRIVATE> ] if ; : restart-timer ( timer -- ) - t >>restart? dup quotation-running?>> [ - drop + t >>restart? drop ] [ - dup thread>> [ nip interrupt ] [ start-timer ] if* + dup thread>> [ interrupt ] when* start-timer ] if ;