     ] tri ;
 
 : invalidate-run-loop-timers ( -- )
-    run-loop [
+    get-run-loop [
         [ [ CFRunLoopTimerInvalidate ] [ CFRelease ] bi ] each
         V{ } clone
     ] change-timers drop ;
 
 : reset-run-loop ( -- )
-    run-loop
+    get-run-loop
     [ timers>> [ reset-timer ] each ]
     [ fds>> [ enable-all-callbacks ] each ] bi ;
 


: add-timer-to-run-loop ( timer -- )
    [ reset-timer ]
    [ run-loop timers>> push ]
    [
        CFRunLoopGetMain
        swap CFRunLoopDefaultMode


TUPLE: run-loop-state fds sources timers ;

SYMBOL: run-loop

: <run-loop> ( -- run-loop )
    V{ } clone V{ } clone V{ } clone \ run-loop-state boa ;

: get-run-loop ( -- run-loop )
    \ run-loop [ <run-loop> ] initialize-alien ;

: add-source-to-run-loop ( source -- )
    [ get-run-loop sources>> push ]
    [
        CFRunLoopGetMain
        swap CFRunLoopDefaultMode
