#include "M3Runtime.h" #define t2 ADDRESS #define t80 void typedef int t8; #line 58 ".ROOT/.boots/corelib/Interfaces/Ctypes.i3" typedef struct { char* elts; int size[1]; } t39; #line 26 "Thread.m3" #define t3 t39 PRIVATE void t2_PrintProc (); #line 581 PRIVATE typecell t2_TC; PRIVATE typecell t2_TC_init = {0, 0, 0, 0, 0, (PROC)NIL, -2, 0, NIL, 1, 4, (PROC)NIL, (PROC)NIL, t2_PrintProc, #line 581 "", -697510072, 624985793}; PRIVATE TYPE TC2 = &t2_TC; #line 498 #define t11 ADDRESS typedef struct { #line 125 ".ROOT/.boots/corelib/Interfaces/CoreOS.i3" t8 _sc_onstack; t8 _sc_mask; t8 _sc_sp; t8 _sc_pc; t8 _sc_ps; } t12; #line 498 "Thread.m3" PRIVATE void t11_PrintProc (); PRIVATE typecell t11_TC; PRIVATE typecell t11_TC_init = {0, 0, 0, 0, 0, (PROC)NIL, 20, 0, NIL, 0, 0, (PROC)NIL, (PROC)NIL, t11_PrintProc, #line 498 "", 467594205, 652907876}; PRIVATE TYPE TC11 = &t11_TC; #define t14 ADDRESS #define TC14 TC_ADDRESS IMPORT TYPE TC_ADDRESS; IMPORT char VS_ADDRESS__30f7308738738b44; #define t20 ADDRESS #define TC20 TC_REFANY IMPORT TYPE TC_REFANY; IMPORT char VS_REFANY__4b8748e831fc107a; #line 63 ".ROOT/.boots/corelib/Interfaces/Ctypes.i3" #define t40 ADDRESS typedef short t62; typedef unsigned char t61; #line 63 #define t38 t39 typedef struct { t61 elts[4096]; } t63; #line 63 #define TC40 TC_Ctypes__String4096 IMPORT TYPE TC_Ctypes__String4096; #line 63 IMPORT char VS_Ctypes__String4096__8d2ce04b3a64ff9f; #line 62 #define t41 ADDRESS typedef short t64; #line 62 typedef struct { t61 elts[1024]; } t65; #define TC41 TC_Ctypes__String1024 IMPORT TYPE TC_Ctypes__String1024; #line 62 IMPORT char VS_Ctypes__String1024__85fe08042cc88853; #line 61 #define t42 ADDRESS typedef unsigned char t56; #line 61 typedef struct { t61 elts[256]; } t66; #define TC42 TC_Ctypes__String256 IMPORT TYPE TC_Ctypes__String256; #line 61 IMPORT char VS_Ctypes__String256__e84eeb8129c76f43; #line 60 #define t43 ADDRESS typedef signed_char t67; #line 60 typedef struct { t61 elts[64]; } t68; #define TC43 TC_Ctypes__String64 IMPORT TYPE TC_Ctypes__String64; #line 60 IMPORT char VS_Ctypes__String64__e232939e2f4ff601; #line 59 #define t44 ADDRESS typedef signed_char t69; #line 59 typedef struct { t61 elts[16]; } t70; #define TC44 TC_Ctypes__String16 IMPORT TYPE TC_Ctypes__String16; #line 59 IMPORT char VS_Ctypes__String16__46fccbf225a113eb; #line 58 #define t45 ADDRESS typedef signed_char t71; #line 58 typedef struct { t61 elts[4]; } t72; #define TC45 TC_Ctypes__String4 IMPORT TYPE TC_Ctypes__String4; #line 58 IMPORT char VS_Ctypes__String4__1ecbc452350ba764; #line 52 #define t46 ADDRESS typedef unsigned short t36; #line 52 #define TC46 TC_Ctypes__UnsignedShortStar IMPORT TYPE TC_Ctypes__UnsignedShortStar; #line 52 IMPORT char VS_Ctypes__UnsignedShortStar__ba7321c22f5477f7; #line 50 #define t47 ADDRESS #define t48 ADDRESS typedef short t37; #line 49 #define TC48 TC_Ctypes__ShortStar IMPORT TYPE TC_Ctypes__ShortStar; #line 49 IMPORT char VS_Ctypes__ShortStar__ceeffab3338d5be6; #define TC47 TC_Ctypes__ShortStarStar IMPORT TYPE TC_Ctypes__ShortStarStar; #line 50 IMPORT char VS_Ctypes__ShortStarStar__1827fd6f22a4a56a; #line 46 #define t49 ADDRESS #define TC49 TC_Ctypes__IntStar IMPORT TYPE TC_Ctypes__IntStar; #line 46 IMPORT char VS_Ctypes__IntStar__e39a77b6392d7c83; #line 44 #define t50 ADDRESS #define TC50 TC_Ctypes__IntStarStar IMPORT TYPE TC_Ctypes__IntStarStar; #line 44 IMPORT char VS_Ctypes__IntStarStar__a46afe5b32b9d475; #line 33 #define t52 ADDRESS typedef float t53; #line 33 #define TC52 TC_Ctypes__FloatStar IMPORT TYPE TC_Ctypes__FloatStar; #line 33 IMPORT char VS_Ctypes__FloatStar__6c7e0b722780a93f; #line 26 #define t54 ADDRESS #define TC54 TC_Ctypes__UnsignedCharStar IMPORT TYPE TC_Ctypes__UnsignedCharStar; #line 26 IMPORT char VS_Ctypes__UnsignedCharStar__5ba21f95225c580b; #define t55 ADDRESS #define TC55 TC_Ctypes__UnsignedCharStarStar IMPORT TYPE TC_Ctypes__UnsignedCharStarStar; #line 27 IMPORT char VS_Ctypes__UnsignedCharStarStar__64970e213b9e555a; #line 24 #define t57 ADDRESS #define t58 ADDRESS #define TC58 TC_Ctypes__CharStarStar IMPORT TYPE TC_Ctypes__CharStarStar; #line 23 IMPORT char VS_Ctypes__CharStarStar__5cd33554337263a0; #define TC57 TC_Ctypes__CharStarStarStar IMPORT TYPE TC_Ctypes__CharStarStarStar; #line 24 IMPORT char VS_Ctypes__CharStarStarStar__a792f1ad3925ee76; #line 17 #define t60 ADDRESS typedef double t51; #line 17 #define TC60 TC_Ctypes__DoubleStar IMPORT TYPE TC_Ctypes__DoubleStar; #line 17 IMPORT char VS_Ctypes__DoubleStar__09a97cc036088f62; #define t83 ADDRESS #define TC83 TC_NULL IMPORT TYPE TC_NULL; IMPORT char VS_NULL__fb50c7d53bec30dc; #line 106 "Thread.m3" #define t1 t39 typedef struct { #line 55 ".ROOT/.boots/corelib/Interfaces/Time.i3" t8 _seconds; t8 _microseconds; } t4; #line 569 "Thread.m3" typedef t80 (*t5)(); #line 100 ".ROOT/.boots/corelib/Interfaces/CoreOS.i3" typedef struct { t8 _tz_minuteswest; t8 _tz_dsttime; } t6; #line 96 typedef struct { t8 _tv_sec; t8 _tv_usec; } t7; #line 136 typedef struct { t5 _sv_handler; t8 _sv_mask; t8 _sv_flags; } t9; #line 104 typedef struct { t7 _it_interval; t7 _it_value; } t10; #define t78 ADDRESS typedef struct { TYPE self; int private; } t78_methods; #define t78_msize (sizeof (t78_methods)) typedef struct { ADDRESS methods; } t78_fields; #define t78_size (sizeof (t78_fields)) #define TC78 TC_ROOT IMPORT TYPE TC_ROOT; IMPORT char VS_ROOT__349f58f628be0ac6; #define t78_MapProc TC_ROOT->mapProc #define t13 ADDRESS #define TC13 TC_Thread__T IMPORT TYPE TC_Thread__T; #line 15 "./Thread.i3" IMPORT char VS_Thread__T__2555b70b3f7780b1; #define t13_MapProc TC_Thread__T->mapProc typedef t13 (*t15)(); #define t16 ADDRESS #define TC16 TC_MUTEX IMPORT TYPE TC_MUTEX; IMPORT char VS_MUTEX__1f9d4e89391ab815; #define t16_MapProc TC_MUTEX->mapProc typedef unsigned char t17; #line 315 "Thread.m3" typedef t17 (*t18)(); #line 21 "./Thread.i3" #define t19 ADDRESS #define TC19 TC_Thread__Condition IMPORT TYPE TC_Thread__Condition; #line 21 IMPORT char VS_Thread__Condition__26d5968239e08f4e; #define t19_MapProc TC_Thread__Condition->mapProc typedef t20 (*t21)(); #define t22 ADDRESS typedef int t23; #line 23 #define t24 ADDRESS #line 23 typedef struct { t21 _apply; } t24_methods; #define t24_msize (sizeof (t24_methods)) typedef struct { #line 23 int filler; } t24_fields; #define t24_size (sizeof (t24_fields)) #define TC24 TC_Thread__Closure IMPORT TYPE TC_Thread__Closure; #line 23 IMPORT char VS_Thread__Closure__7fb5c6232c5a658a; #define t24_MapProc TC_Thread__Closure->mapProc typedef struct { int filler; } t22_methods; #define t22_msize (sizeof (t22_methods)) typedef struct { #line 28 t23 _stackSize; } t22_fields; #define t22_size (sizeof (t22_fields)) #define TC22 TC_Thread__SizedClosure IMPORT TYPE TC_Thread__SizedClosure; #line 28 IMPORT char VS_Thread__SizedClosure__8a46717d2eae7b07; #define t22_MapProc TC_Thread__SizedClosure->mapProc typedef unsigned char t25; #line 117 "Thread.m3" typedef t19 (*t26)(); #line 112 typedef t16 (*t27)(); #line 106 typedef short t28; typedef struct { t2 elts[2001]; } t29; #line 53 #define t30 ADDRESS #line 53 typedef struct { int filler; } t30_methods; #define t30_msize (sizeof (t30_methods)) typedef struct { #line 53 t25 _state; t24 _closure; t20 _result; t2 _stack; t2 _context; t13 _previous; t13 _next; t13 _nextRunning; t13 _previousRunning; #line 53 t13 _nextWaiting; t19 _waitingForCondition; t4 _waitingForTime; t17 _alertable; t17 _alertPending; t19 _endCondition; } t30_fields; #line 53 #define t30_size (sizeof (t30_fields)) PRIVATE void t30_InitProc (); #line 53 PRIVATE void t30_SetupProc (); PRIVATE void t30_PrintProc (); PRIVATE void t30_MapProc (); PRIVATE typecell t30_TC; PRIVATE typecell t30_TC_init = {0, 0, 0, 0, 0, t30_MapProc, #line 53 t30_size, t30_msize, NIL, 0, 0, t30_InitProc, t30_SetupProc, t30_PrintProc, "Thread.T v1.3", -1630555197, 954408882}; PRIVATE TYPE TC30 = &t30_TC; #line 53 #line 48 #define t31 ADDRESS #line 48 typedef struct { int filler; } t31_methods; #define t31_msize (sizeof (t31_methods)) typedef struct { #line 48 t13 _waitingForMe; } t31_fields; #define t31_size (sizeof (t31_fields)) PRIVATE void t31_InitProc (); #line 48 PRIVATE void t31_SetupProc (); PRIVATE void t31_PrintProc (); PRIVATE void t31_MapProc (); PRIVATE typecell t31_TC; PRIVATE typecell t31_TC_init = {0, 0, 0, 0, 0, t31_MapProc, #line 48 t31_size, t31_msize, NIL, 0, 0, t31_InitProc, t31_SetupProc, t31_PrintProc, "Thread.Condition v1.0", -1275540644, 753060222}; PRIVATE TYPE TC31 = &t31_TC; #line 48 #line 39 #define t32 ADDRESS #line 39 typedef struct { int filler; } t32_methods; #define t32_msize (sizeof (t32_methods)) typedef struct { #line 39 t8 _sem; t13 _waitingForMe; } t32_fields; #define t32_size (sizeof (t32_fields)) PRIVATE void t32_InitProc (); #line 39 PRIVATE void t32_SetupProc (); PRIVATE void t32_PrintProc (); PRIVATE void t32_MapProc (); PRIVATE typecell t32_TC; PRIVATE typecell t32_TC_init = {0, 0, 0, 0, 0, t32_MapProc, #line 39 t32_size, t32_msize, NIL, 0, 0, t32_InitProc, t32_SetupProc, t32_PrintProc, "Mutex 1.0", -117718547, 840188762}; PRIVATE TYPE TC32 = &t32_TC; #line 39 #line 21 ".ROOT/.boots/corelib/Interfaces/Cstdlib.i3" typedef t8 (*t33)(); #line 19 typedef t14 (*t34)(); #line 33 ".ROOT/.boots/corelib/Interfaces/CoreOS.i3" typedef struct { t8 _st_dev; t8 _st_ino; t8 _st_mode; t36 _st_nlink; t36 _st_uid; t8 _st_gid; t8 _st_rdev; t8 _st_size; t8 _st_atime; #line 33 t8 _st_spare1; t8 _st_mtime; t8 _st_spare2; t8 _st_ctime; t8 _st_spare3; t8 _st_blksize; t8 _st_blocks; t8 _st_gen; t8 _st_type; #line 33 t8 _st_vfs; t8 _st_flag; t8 _st_cmtcnt; t8 _st_fstore; t8 _st_version; t37 _st_css; t37 _st_ss; t37 _st_rdevsite; t37 _st_spare4; #line 33 t8 _st_nid; t8 _st_uid_raw; t8 _st_gid_raw; t8 _st_uid_rev_tag; t8 _st_gid_rev_tag; } t35; #line 19 ".ROOT/.boots/corelib/Interfaces/Ctypes.i3" typedef signed_char t59; #line 109 ".ROOT/.boots/corelib/Interfaces/Time.i3" typedef struct { t8 _minutesWest; t8 _dstAlgorithm; } t73; typedef void (*t74)(); #line 100 typedef signed_char t75; typedef t75 (*t76)(); #line 97 typedef void (*t77)(); typedef CLOSURE t79; #define t81 ADDRESS #define TC81 TC_TEXT IMPORT TYPE TC_TEXT; IMPORT char VS_TEXT__b7a92447326386f5; #define t81_MapProc TC_TEXT->mapProc #define t82 ADDRESS typedef struct { TYPE self; int private; } t82_methods; #define t82_msize (sizeof (t82_methods)) typedef struct { ADDRESS methods; } t82_fields; #define t82_size (sizeof (t82_fields)) #define TC82 TC_UNTRACED_ROOT IMPORT TYPE TC_UNTRACED_ROOT; IMPORT char VS_UNTRACED_ROOT__3e0964513fd6da20; #line 7 "Thread.m3" IMPORT INITLINK* ThreadSup__init; IMPORT INITLINK* Cstdlib__init; IMPORT INITLINK* CoreOS__init; IMPORT INITLINK* Time__init; #line 7 IMPORT INITLINK* Word__init; IMPORT INITLINK* ThreadF__init; IMPORT INITLINK* Thread__init; IMPORT t13 _ThreadSup__self; #line 7 IMPORT char VS_ThreadSup__self__d8ab6afe2b3c018a; IMPORT t8 _ThreadSup__inCritical; IMPORT char VS_ThreadSup__inCritical__651d6d3526469249; #line 7 IMPORT t8 contextSize; IMPORT char VScontextSize__87adc53d28d0aa85; IMPORT t80 InitTopContext (); IMPORT char VSInitTopContext__8b85691223fe4223; #line 7 IMPORT t80 InitContext (); IMPORT char VSInitContext__5129e16e3dfdd6e5; IMPORT t80 Transfer (); IMPORT char VSTransfer__b3d736b72e581f3a; #line 7 IMPORT t80 Tos (); IMPORT char VSTos__31b0b5672ac220f0; IMPORT t80 SelfTos (); IMPORT char VSSelfTos__a70cc057275952d8; #line 7 IMPORT TYPE TC_Ctypes__const_char_star; IMPORT char VS_Ctypes__const_char_star__81d35d212987031d; IMPORT TYPE TC_Ctypes__char_star; #line 7 IMPORT char VS_Ctypes__char_star__90cf39683847e5e8; IMPORT t80 exit (); IMPORT char VSexit__8e4725ea281cf6b5; IMPORT t8 gettimeofday (); #line 7 IMPORT char VSgettimeofday__ae64c4e03a1134e0; IMPORT char VS_CoreOS__ITIMER_REAL__7e8ed4a129003c6c; IMPORT char VS_CoreOS__ITIMER_VIRTUAL__82f12a953a44a467; #line 7 IMPORT t8 setitimer (); IMPORT char VSsetitimer__c207fd492a9aefd2; IMPORT char VS_CoreOS__SIGALRM__048d5d6725482abf; IMPORT char VS_CoreOS__SIGVTALRM__c9e8638924c06f0d; #line 7 IMPORT t8 sigvec (); IMPORT char VSsigvec__2dfcab9d253a1c20; IMPORT t8 sigsetmask (); IMPORT char VSsigsetmask__30d07c2a27e6e5ce; #line 7 IMPORT t8 sigpause (); IMPORT char VSsigpause__ca909fcf39ca7b56; IMPORT t8 _CoreOS__sigmask (); IMPORT char VS_CoreOS__sigmask__3ebfaf72317836e8; #line 7 IMPORT EXCEPTION_NAME _Thread__Alerted; IMPORT char VS_Thread__Alerted__fc88feb43485af46; IMPORT void _Time__Now (); IMPORT char VS_Time__Now__1cf048602fe0a57c; #line 7 IMPORT void _Time__Subtract (); IMPORT char VS_Time__Subtract__a5e6bd09359aa50f; IMPORT t75 _Time__Compare (); IMPORT char VS_Time__Compare__9a4ce2942f11a212; #line 7 IMPORT EXCEPTION_NAME _Time__NoPrivileges; IMPORT char VS_Time__NoPrivileges__6cb57575330ad093; IMPORT t8 _Word__And (); #line 7 IMPORT char VS_Word__And__479727d22e0cef9f; IMPORT t8 _Word__Or (); IMPORT char VS_Word__Or__6e0e049826e116f7; IMPORT t8 _Word__Not (); #line 7 IMPORT char VS_Word__Not__e5602ba93e6fe1e1; EXPORT t80 _ThreadF__ProcessStacks (); EXPORT char VS_ThreadF__ProcessStacks__07ce4b2f34493afe = '\0'; #line 7 EXPORT t80 _ThreadF__Pause (); EXPORT char VS_ThreadF__Pause__e6785a583a691f40 = '\0'; EXPORT t80 _ThreadF__SetSwitchingInterval (); #line 7 EXPORT char VS_ThreadF__SetSwitchingInterval__89dd6ba82326bf22 = '\0'; EXPORT t80 _ThreadF__Shell (); EXPORT char VS_ThreadF__Shell__6fcbf57b391a9e85 = '\0'; #line 7 IMPORT char VS_Thread__DefaultStackSize__0c949e2e2def4e40; IMPORT TYPE TC_Thread__Mutex; IMPORT char VS_Thread__Mutex__4f5c12072cdeec3e; #line 7 EXPORT t16 _Thread__NewMutex (); EXPORT char VS_Thread__NewMutex__15398f4b3009e1dc = '\0'; EXPORT t19 _Thread__NewCondition (); #line 7 EXPORT char VS_Thread__NewCondition__5bf986db2b342179 = '\0'; EXPORT t13 _Thread__Fork (); EXPORT char VS_Thread__Fork__ef3a2f9230b337c8 = '\0'; #line 7 EXPORT t20 _Thread__Join (); EXPORT char VS_Thread__Join__4341274725ba29c2 = '\0'; EXPORT t80 _Thread__Wait (); EXPORT char VS_Thread__Wait__c083964332379bed = '\0'; #line 7 EXPORT t80 _Thread__Acquire (); EXPORT char VS_Thread__Acquire__4f2412f3260f1927 = '\0'; EXPORT t80 _Thread__Release (); EXPORT char VS_Thread__Release__539a01d7243a726e = '\0'; #line 7 EXPORT t80 _Thread__Broadcast (); EXPORT char VS_Thread__Broadcast__11fc5a192fbbaeab = '\0'; EXPORT t80 _Thread__Signal (); #line 7 EXPORT char VS_Thread__Signal__ebee2db02dc779f7 = '\0'; EXPORT t13 _Thread__Self (); EXPORT char VS_Thread__Self__a246fed12a2d90d9 = '\0'; #line 7 EXPORT t80 _Thread__Alert (); EXPORT char VS_Thread__Alert__1131dec43b9866e6 = '\0'; EXPORT t17 _Thread__TestAlert (); EXPORT char VS_Thread__TestAlert__cd6b7dbf31cf31ce = '\0'; #line 7 EXPORT t80 _Thread__AlertWait (); EXPORT char VS_Thread__AlertWait__f0ec408b33a29632 = '\0'; EXPORT t20 _Thread__AlertJoin (); #line 7 EXPORT char VS_Thread__AlertJoin__3714d01c23a59a9a = '\0'; EXPORT t80 _Thread__Yield (); EXPORT char VS_Thread__Yield__cf7d94fc3f11c25f = '\0'; #line 7 PRIVATE t17 _Thread__multipleThreads; PRIVATE t13 _Thread__topThread; PRIVATE t13 _Thread__pausedThreads; PRIVATE t7 _Thread__selected_interval; #line 7 PRIVATE t29 _Thread__stackPool; PRIVATE t8 _Thread__stackPoolSize; PRIVATE t29 _Thread__contextPool; PRIVATE t8 _Thread__contextPoolSize; #line 7 PRIVATE EXCEPTION_NAME _Thread__DeadThread = "_Thread__DeadThread"; PRIVATE EXCEPTION_NAME _Thread__InternalError = "_Thread__InternalError"; #line 7 PRIVATE t80 _Thread__CanRun (); PRIVATE t80 _Thread__ICannotRun (); PRIVATE t20 _Thread__XJoin (); PRIVATE t80 _Thread__XWait (); #line 7 PRIVATE t80 _Thread__XSignal (); PRIVATE t80 _Thread__ResumeScheduling (); PRIVATE t80 _Thread__StartSwitching (); PRIVATE t80 _Thread__switch_thread (); #line 7 PRIVATE t80 _Thread__allow_sigprof (); PRIVATE t80 _Thread__disallow_sigprof (); PRIVATE t80 _Thread__DelayProfTimer (); #line 7 EXPORT char VS_Thread__T__59a7f71d2ac00268 = '\0'; EXPORT char VS_Thread__Condition__afb0362923c3ac0f = '\0'; EXPORT char VS_MUTEX__fe2dd4372f9a269e = '\0'; #line 7 void Thread__MMap (p) void (*p) (); { ADDRESS r = NIL; ADDRESS c = NIL; CHECKSTACKOVERFLOW; p (& (_Thread__topThread), r, c); #line 7 p (& (_Thread__pausedThreads), r, c); }; #line 200 PRIVATE EXCEPTION_NAME *raises_7 [] = { & _Thread__Alerted, & _Thread__DeadThread, (EXCEPTION_NAME *) NULL}; PRIVATE EXCEPTION_NAME *raises_8 [] = { & _Thread__Alerted, & _Thread__DeadThread, (EXCEPTION_NAME *) NULL}; #line 230 PRIVATE EXCEPTION_NAME *raises_2 [] = { & _Thread__Alerted, (EXCEPTION_NAME *) NULL}; PRIVATE EXCEPTION_NAME *raises_9 [] = { & _Thread__Alerted, (EXCEPTION_NAME *) NULL}; #line 112 "Thread.m3" EXPORT t16 _Thread__NewMutex () { t16 z0; #line 112 "Thread.m3" { auto t16 __result; { ZERO1 (& __result); CHECKSTACKOVERFLOW; { register char** ptr = (char**) TNEWOBJ (TC16); z0 = (t16) ptr; }; __result = z0; return __result; } } }; #line 117 "Thread.m3" EXPORT t19 _Thread__NewCondition () { t19 z0; #line 117 "Thread.m3" { auto t19 __result; { ZERO1 (& __result); CHECKSTACKOVERFLOW; { register char** ptr = (char**) TNEWOBJ (TC19); z0 = (t19) ptr; }; __result = z0; return __result; } } }; #line 123 "Thread.m3" PRIVATE t80 _Thread__CanRun (_t) t13 _t; { t17 z2; t13 z1; t13 z3; t13 z4; t17 z5; #line 123 "Thread.m3" { { CHECKSTACKOVERFLOW; z2 = (_t == _ThreadSup__self); if (z2) { NILCHECKA (z1 = _ThreadSup__self); NILCHECKA (z3 = (((t30_fields*)(z1+(0+t32_size+t78_size)))->_nextRunning)); z2 = ((((t30_fields*)(z3+(0+t32_size+t78_size)))->_state) == 0 ); #line 126 if (z2) { NILCHECKA (z1 = _ThreadSup__self); NILCHECKA (z3 = (((t30_fields*)(z1+(0+t32_size+t78_size)))->_nextRunning)); #line 127 NILCHECKA (z4 = _ThreadSup__self); (((t30_fields*)(z4+(0+t32_size+t78_size)))->_previousRunning) = (((t30_fields*)(z3+(0+t32_size+t78_size)))->_previousRunning); NILCHECKA (z3 = _ThreadSup__self); NILCHECKA (z4 = (((t30_fields*)(z3+(0+t32_size+t78_size)))->_nextRunning)); #line 128 NILCHECKA (z3 = (((t30_fields*)(z4+(0+t32_size+t78_size)))->_previousRunning)); (((t30_fields*)(z3+(0+t32_size+t78_size)))->_nextRunning) = _ThreadSup__self; NILCHECKA (z3 = _ThreadSup__self); NILCHECKA (z4 = (((t30_fields*)(z3+(0+t32_size+t78_size)))->_nextRunning)); #line 129 (((t30_fields*)(z4+(0+t32_size+t78_size)))->_previousRunning) = _ThreadSup__self; goto if_2_end; }; NILCHECKA (z3 = _ThreadSup__self); (((t30_fields*)(z3+(0+t32_size+t78_size)))->_nextRunning) = _ThreadSup__self; NILCHECKA (z3 = _ThreadSup__self); (((t30_fields*)(z3+(0+t32_size+t78_size)))->_previousRunning) = _ThreadSup__self; #line 132 if_2_end: /**/; goto if_1_end; }; NILCHECKA (z1 = _ThreadSup__self); z5 = ((((t30_fields*)(z1+(0+t32_size+t78_size)))->_state) == 0 ); #line 132 if (z5) { NILCHECKA (z3 = _ThreadSup__self); NILCHECKA (z4 = (((t30_fields*)(z3+(0+t32_size+t78_size)))->_nextRunning)); (((t30_fields*)(z4+(0+t32_size+t78_size)))->_previousRunning) = _t; NILCHECKA (z1 = _ThreadSup__self); NILCHECKA (z3 = _t); (((t30_fields*)(z3+(0+t32_size+t78_size)))->_nextRunning) = (((t30_fields*)(z1+(0+t32_size+t78_size)))->_nextRunning); NILCHECKA (z3 = _ThreadSup__self); (((t30_fields*)(z3+(0+t32_size+t78_size)))->_nextRunning) = _t; NILCHECKA (z3 = _t); (((t30_fields*)(z3+(0+t32_size+t78_size)))->_previousRunning) = _ThreadSup__self; goto if_1_end; #line 137 }; NILCHECKA (z1 = _ThreadSup__self); NILCHECKA (z3 = (((t30_fields*)(z1+(0+t32_size+t78_size)))->_nextRunning)); z2 = ((((t30_fields*)(z3+(0+t32_size+t78_size)))->_state) == 0 ); #line 137 if (z2) { NILCHECKA (z3 = _ThreadSup__self); NILCHECKA (z4 = (((t30_fields*)(z3+(0+t32_size+t78_size)))->_nextRunning)); NILCHECKA (z3 = (((t30_fields*)(z4+(0+t32_size+t78_size)))->_previousRunning)); #line 139 (((t30_fields*)(z3+(0+t32_size+t78_size)))->_nextRunning) = _t; NILCHECKA (z1 = _ThreadSup__self); NILCHECKA (z3 = (((t30_fields*)(z1+(0+t32_size+t78_size)))->_nextRunning)); NILCHECKA (z4 = _t); #line 140 (((t30_fields*)(z4+(0+t32_size+t78_size)))->_previousRunning) = (((t30_fields*)(z3+(0+t32_size+t78_size)))->_previousRunning); NILCHECKA (z1 = _ThreadSup__self); NILCHECKA (z3 = _t); (((t30_fields*)(z3+(0+t32_size+t78_size)))->_nextRunning) = (((t30_fields*)(z1+(0+t32_size+t78_size)))->_nextRunning); NILCHECKA (z3 = _ThreadSup__self); NILCHECKA (z4 = (((t30_fields*)(z3+(0+t32_size+t78_size)))->_nextRunning)); (((t30_fields*)(z4+(0+t32_size+t78_size)))->_previousRunning) = _t; #line 142 goto if_1_end; }; NILCHECKA (z3 = _ThreadSup__self); (((t30_fields*)(z3+(0+t32_size+t78_size)))->_nextRunning) = _t; NILCHECKA (z3 = _t); (((t30_fields*)(z3+(0+t32_size+t78_size)))->_previousRunning) = _t; NILCHECKA (z3 = _t); (((t30_fields*)(z3+(0+t32_size+t78_size)))->_nextRunning) = _t; if_1_end: /**/; NILCHECKA (z3 = _t); (((t30_fields*)(z3+(0+t32_size+t78_size)))->_state) = 0 ; } } }; #line 150 "Thread.m3" PRIVATE t80 _Thread__ICannotRun (_newState) t25 _newState; { t13 z2; t13 z1; t13 z3; #line 150 "Thread.m3" { { CHECKSTACKOVERFLOW; NILCHECKA (z2 = _ThreadSup__self); (((t30_fields*)(z2+(0+t32_size+t78_size)))->_state) = _newState; NILCHECKA (z1 = _ThreadSup__self); NILCHECKA (z3 = (((t30_fields*)(z1+(0+t32_size+t78_size)))->_nextRunning)); (((t30_fields*)(z3+(0+t32_size+t78_size)))->_previousRunning) = (((t30_fields*)(z1+(0+t32_size+t78_size)))->_previousRunning); NILCHECKA (z1 = _ThreadSup__self); NILCHECKA (z3 = (((t30_fields*)(z1+(0+t32_size+t78_size)))->_previousRunning)); (((t30_fields*)(z3+(0+t32_size+t78_size)))->_nextRunning) = (((t30_fields*)(z1+(0+t32_size+t78_size)))->_nextRunning); #line 154 } } }; #line 157 "Thread.m3" EXPORT t13 _Thread__Fork (_cl) t24 _cl; { t17 z1; t13 z0; t17 z2; t8 z3; t13 z4; t2 z5; t22 z6; t17 z7; t19 z8; t13 z9; t8 z10; t8 z11; t14 z12; t14 z13; t23 z14; #line 157 "Thread.m3" { auto t13 _t; auto t23 _size; auto t13 __result; { ZERO1 (& _t); ZERO1 (& _size); #line 157 ZERO1 (& __result); CHECKSTACKOVERFLOW; _ThreadSup__inCritical += 1 ; z1 = ! _Thread__multipleThreads; if (z1) { _Thread__multipleThreads = 1 ; _Thread__StartSwitching (); goto if_3_end; }; if_3_end: /**/; { register char** ptr = (char**) TNEWOBJ (TC13); ((t30_fields*)((char*)ptr + (0+t32_size+t78_size)))->_closure = _cl; #line 168 ((t30_fields*)((char*)ptr + (0+t32_size+t78_size)))->_result = 0; ((t30_fields*)((char*)ptr + (0+t32_size+t78_size)))->_alertPending = 0 ; #line 168 z0 = (t13) ptr; }; _t = z0; z2 = (_Thread__contextPoolSize > 0 ); if (z2) { _Thread__contextPoolSize -= 1 ; z3 = _Thread__contextPoolSize; if ((z3 < 0) || (2000 < z3)) RANGEFAULT; NILCHECKA (z4 = _t); (((t30_fields*)(z4+(0+t32_size+t78_size)))->_context) = (_Thread__contextPool.elts[z3]); #line 171 goto if_4_end; }; { register t39* ptr; int sz[1]; sz[0] = contextSize; ptr = (t39*) UNEWA(TC2, 8 + sz[0] * 4); ptr->elts = (char*)(& ptr->size[1]); #line 173 ptr->size[0] = sz[0]; z5 = (t2) ptr; }; NILCHECKA (z4 = _t); (((t30_fields*)(z4+(0+t32_size+t78_size)))->_context) = z5; #line 173 if_4_end: /**/; { register ADDRESS ref = (ADDRESS) _cl; register int tc = TYPECODE (ref); if (ISSUBTYPE (tc, TC22)) goto tc0_0; goto tc0_else; #line 174 tc0_0:; { auto t22 _scl; { ZERO1 (& _scl); #line 174 _scl = (t22) ref; NILCHECKA (z6 = _scl); _size = (((t22_fields*)(z6+(0+t24_size+t78_size)))->_stackSize); } } goto tc0_exit; #line 175 tc0_else:; _size = 3000 ; tc0_exit:; }; z2 = (_size == 3000 ); z1 = 0; if (z2) { z7 = (_Thread__stackPoolSize > 0 ); z1 = z7; }; if (z1) { _Thread__stackPoolSize -= 1 ; z3 = _Thread__stackPoolSize; if ((z3 < 0) || (2000 < z3)) RANGEFAULT; NILCHECKA (z4 = _t); (((t30_fields*)(z4+(0+t32_size+t78_size)))->_stack) = (_Thread__stackPool.elts[z3]); #line 179 goto if_5_end; }; { register t39* ptr; int sz[1]; sz[0] = _size; ptr = (t39*) UNEWA(TC2, 8 + sz[0] * 4); ptr->elts = (char*)(& ptr->size[1]); #line 181 ptr->size[0] = sz[0]; z5 = (t2) ptr; }; NILCHECKA (z4 = _t); (((t30_fields*)(z4+(0+t32_size+t78_size)))->_stack) = z5; #line 181 if_5_end: /**/; z8 = _Thread__NewCondition (); NILCHECKA (z4 = _t); (((t30_fields*)(z4+(0+t32_size+t78_size)))->_endCondition) = z8; NILCHECKA (z4 = _ThreadSup__self); NILCHECKA (z9 = _t); (((t30_fields*)(z9+(0+t32_size+t78_size)))->_next) = (((t30_fields*)(z4+(0+t32_size+t78_size)))->_next); NILCHECKA (z4 = _t); (((t30_fields*)(z4+(0+t32_size+t78_size)))->_previous) = _ThreadSup__self; NILCHECKA (z4 = _ThreadSup__self); NILCHECKA (z9 = (((t30_fields*)(z4+(0+t32_size+t78_size)))->_next)); (((t30_fields*)(z9+(0+t32_size+t78_size)))->_previous) = _t; NILCHECKA (z4 = _ThreadSup__self); (((t30_fields*)(z4+(0+t32_size+t78_size)))->_next) = _t; NILCHECKA (z4 = _t); NILCHECKB (z5 = (((t30_fields*)(z4+(0+t32_size+t78_size)))->_context)); { register t39* array = & (*((t3*) z5)); #line 188 z11 = 0 ; if (z11 >= (array->size[0])) RANGEFAULT; z10 = (int)(array->elts + (z11 * 4)); }; z12 = (char*)(& (*(t8*)z10)); #line 188 NILCHECKA (z4 = _t); NILCHECKB (z5 = (((t30_fields*)(z4+(0+t32_size+t78_size)))->_stack)); { register t39* array = & (*((t3*) z5)); #line 188 z11 = 0 ; if (z11 >= (array->size[0])) RANGEFAULT; z10 = (int)(array->elts + (z11 * 4)); }; z13 = (char*)(& (*(t8*)z10)); #line 188 NILCHECKA (z4 = _t); NILCHECKB (z5 = (((t30_fields*)(z4+(0+t32_size+t78_size)))->_stack)); z14 = (*((t3*) z5)).size[0]; #line 188 InitContext (_t, z12, z13, z14); _Thread__CanRun (_t); _ThreadSup__inCritical -= 1 ; __result = _t; return __result; } } }; #line 194 "Thread.m3" EXPORT t20 _Thread__Join (_t) t13 _t; { t20 z3; #line 194 "Thread.m3" { auto t20 __result; { ZERO1 (& __result); CHECKSTACKOVERFLOW; _ThreadSup__inCritical += 1 ; { HANDLER hfinally_0; PUSH_FINALLY (hfinally_0, finally_0); #line 198 z3 = _Thread__XJoin (_t, 0 ); __result = z3; hfinally_0.exception = RETURN_EXCEPTION; goto finally_0; finally_0: #line 198 CUT_TO_NEXT_HANDLER (hfinally_0); _ThreadSup__inCritical -= 1 ; if (hfinally_0.exception != FALL_EXCEPTION) { if (hfinally_0.exception == RETURN_EXCEPTION) { #line 200 return __result; }; RAISE_FOR_SURE (hfinally_0.exception); }; }; } } }; #line 203 "Thread.m3" EXPORT t20 _Thread__AlertJoin (_t) t13 _t; { t20 z3; #line 203 "Thread.m3" { HANDLER hproc_0; PUSH_RAISES (hproc_0, raises_7, proc_0); { auto t20 __result; { ZERO1 (& __result); CHECKSTACKOVERFLOW; _ThreadSup__inCritical += 1 ; { HANDLER hfinally_1; PUSH_FINALLY (hfinally_1, finally_1); #line 207 z3 = _Thread__XJoin (_t, 1 ); __result = z3; hfinally_1.exception = RETURN_EXCEPTION; goto finally_1; finally_1: #line 207 CUT_TO_NEXT_HANDLER (hfinally_1); _ThreadSup__inCritical -= 1 ; if (hfinally_1.exception != FALL_EXCEPTION) { if (hfinally_1.exception == RETURN_EXCEPTION) { #line 209 CUT_TO_NEXT_HANDLER (hproc_0); return __result; }; hproc_0.exception = hfinally_1.exception; goto proc_0; #line 209 }; }; } } proc_0: CUT_TO_NEXT_HANDLER (hproc_0); if (hproc_0.exception != 0) RAISE_FOR_SURE (hproc_0.exception); }; }; #line 212 "Thread.m3" PRIVATE t20 _Thread__XJoin (_t, _alertable) t13 _t; t17 _alertable; { t13 z1; t17 z3; t17 z0; t13 z2; t17 z4; t13 z5; #line 212 "Thread.m3" { HANDLER hproc_0; PUSH_RAISES (hproc_0, raises_8, proc_0); { auto t20 __result; { ZERO1 (& __result); CHECKSTACKOVERFLOW; { register t16 mu = (t16)_t; _Thread__Acquire (mu); { HANDLER hlock_0; PUSH_FINALLY (hlock_0, lock_0); NILCHECKA (z1 = _t); z3 = ((((t30_fields*)(z1+(0+t32_size+t78_size)))->_state) != 4 ); z0 = 0; if (z3) { NILCHECKA (z2 = _t); #line 216 z4 = ((((t30_fields*)(z2+(0+t32_size+t78_size)))->_state) != 5 ); z0 = z4; }; if (z0) do { NILCHECKA (z5 = _t); _Thread__XWait (_t, (((t30_fields*)(z5+(0+t32_size+t78_size)))->_endCondition), _alertable); NILCHECKA (z1 = _t); #line 217 z3 = ((((t30_fields*)(z1+(0+t32_size+t78_size)))->_state) != 4 ); z0 = 0; if (z3) { NILCHECKA (z2 = _t); #line 217 z4 = ((((t30_fields*)(z2+(0+t32_size+t78_size)))->_state) != 5 ); z0 = z4; }; } while (z0); NILCHECKA (z1 = _t); switch ((((t30_fields*)(z1+(0+t32_size+t78_size)))->_state)) { case 4: NILCHECKA (z2 = _t); (((t30_fields*)(z2+(0+t32_size+t78_size)))->_state) = 5 ; NILCHECKA (z1 = _t); __result = (((t30_fields*)(z1+(0+t32_size+t78_size)))->_result); #line 219 hlock_0.exception = RETURN_EXCEPTION; goto lock_0; case 5: RAISE (& _Thread__DeadThread, 0, 0); default: /**/; if (! 0 ) ASSERTFAULT; }; lock_0: CUT_TO_NEXT_HANDLER (hlock_0); _Thread__Release (mu); if (hlock_0.exception != FALL_EXCEPTION) { if (hlock_0.exception == RETURN_EXCEPTION) { #line 221 CUT_TO_NEXT_HANDLER (hproc_0); return __result; }; hproc_0.exception = hlock_0.exception; goto proc_0; #line 221 }; }; }; } } proc_0: CUT_TO_NEXT_HANDLER (hproc_0); if (hproc_0.exception != 0) RAISE_FOR_SURE (hproc_0.exception); }; }; #line 224 "Thread.m3" EXPORT t80 _Thread__Wait (_m, _c) t16 _m; t19 _c; { #line 224 "Thread.m3" { { CHECKSTACKOVERFLOW; _ThreadSup__inCritical += 1 ; { HANDLER hfinally_2; PUSH_FINALLY (hfinally_2, finally_2); #line 228 _Thread__XWait (_m, _c, 0 ); finally_2: CUT_TO_NEXT_HANDLER (hfinally_2); _ThreadSup__inCritical -= 1 ; if (hfinally_2.exception != FALL_EXCEPTION) { RAISE_FOR_SURE (hfinally_2.exception); #line 230 }; }; } } }; #line 233 "Thread.m3" EXPORT t80 _Thread__AlertWait (_m, _c) t16 _m; t19 _c; { #line 233 "Thread.m3" { HANDLER hproc_0; PUSH_RAISES (hproc_0, raises_2, proc_0); { { CHECKSTACKOVERFLOW; _ThreadSup__inCritical += 1 ; { HANDLER hfinally_3; PUSH_FINALLY (hfinally_3, finally_3); #line 237 _Thread__XWait (_m, _c, 1 ); finally_3: CUT_TO_NEXT_HANDLER (hfinally_3); _ThreadSup__inCritical -= 1 ; if (hfinally_3.exception != FALL_EXCEPTION) { hproc_0.exception = hfinally_3.exception; #line 239 goto proc_0; }; }; } } proc_0: CUT_TO_NEXT_HANDLER (hproc_0); if (hproc_0.exception != 0) RAISE_FOR_SURE (hproc_0.exception); #line 239 }; }; #line 243 "Thread.m3" PRIVATE t80 _Thread__XWait (_m, _c, _alertable) t16 _m; t19 _c; t17 _alertable; { t17 z1; t13 z2; t19 z3; #line 243 "Thread.m3" { HANDLER hproc_0; PUSH_RAISES (hproc_0, raises_9, proc_0); { { CHECKSTACKOVERFLOW; z1 = 0; if (_alertable) { NILCHECKA (z2 = _ThreadSup__self); z1 = (((t30_fields*)(z2+(0+t32_size+t78_size)))->_alertPending); #line 245 }; if (z1) { NILCHECKA (z2 = _ThreadSup__self); (((t30_fields*)(z2+(0+t32_size+t78_size)))->_alertPending) = 0 ; RAISE (& _Thread__Alerted, 0, 0); }; _Thread__Release (_m); _Thread__ICannotRun ( 1 ); NILCHECKA (z3 = _c); NILCHECKA (z2 = _ThreadSup__self); (((t30_fields*)(z2+(0+t32_size+t78_size)))->_nextWaiting) = (((t31_fields*)(z3+(0+t78_size)))->_waitingForMe); NILCHECKA (z3 = _c); (((t31_fields*)(z3+(0+t78_size)))->_waitingForMe) = _ThreadSup__self; NILCHECKA (z2 = _ThreadSup__self); (((t30_fields*)(z2+(0+t32_size+t78_size)))->_waitingForCondition) = _c; NILCHECKA (z2 = _ThreadSup__self); (((t30_fields*)(z2+(0+t32_size+t78_size)))->_alertable) = _alertable; _Thread__Yield (); _ThreadSup__inCritical += 1 ; _Thread__Acquire (_m); z1 = 0; if (_alertable) { NILCHECKA (z2 = _ThreadSup__self); z1 = (((t30_fields*)(z2+(0+t32_size+t78_size)))->_alertPending); #line 257 }; if (z1) { NILCHECKA (z2 = _ThreadSup__self); (((t30_fields*)(z2+(0+t32_size+t78_size)))->_alertPending) = 0 ; RAISE (& _Thread__Alerted, 0, 0); }; } } proc_0: CUT_TO_NEXT_HANDLER (hproc_0); if (hproc_0.exception != 0) RAISE_FOR_SURE (hproc_0.exception); #line 259 }; }; #line 262 "Thread.m3" EXPORT t80 _Thread__Signal (_c) t19 _c; { #line 262 "Thread.m3" { { CHECKSTACKOVERFLOW; _ThreadSup__inCritical += 1 ; { HANDLER hfinally_4; PUSH_FINALLY (hfinally_4, finally_4); #line 266 _Thread__XSignal (_c, 1 ); finally_4: CUT_TO_NEXT_HANDLER (hfinally_4); _ThreadSup__inCritical -= 1 ; if (hfinally_4.exception != FALL_EXCEPTION) { RAISE_FOR_SURE (hfinally_4.exception); #line 268 }; }; } } }; #line 271 "Thread.m3" EXPORT t80 _Thread__Broadcast (_c) t19 _c; { t8 z3; #line 271 "Thread.m3" { { CHECKSTACKOVERFLOW; _ThreadSup__inCritical += 1 ; { HANDLER hfinally_5; PUSH_FINALLY (hfinally_5, finally_5); #line 275 z3 = - 1 ; _Thread__XSignal (_c, z3); finally_5: CUT_TO_NEXT_HANDLER (hfinally_5); _ThreadSup__inCritical -= 1 ; if (hfinally_5.exception != FALL_EXCEPTION) { RAISE_FOR_SURE (hfinally_5.exception); #line 277 }; }; } } }; #line 281 "Thread.m3" PRIVATE t80 _Thread__XSignal (_c, _limit) t19 _c; t8 _limit; { t19 z1; t17 z3; t13 z2; t19 z4; #line 281 "Thread.m3" { auto t13 _t; { ZERO1 (& _t); #line 281 CHECKSTACKOVERFLOW; NILCHECKA (z1 = _c); z3 = ((((t31_fields*)(z1+(0+t78_size)))->_waitingForMe) != 0); if (z3) do { NILCHECKA (z1 = _c); _t = (((t31_fields*)(z1+(0+t78_size)))->_waitingForMe); NILCHECKA (z2 = _t); NILCHECKA (z4 = _c); (((t31_fields*)(z4+(0+t78_size)))->_waitingForMe) = (((t30_fields*)(z2+(0+t32_size+t78_size)))->_nextWaiting); NILCHECKA (z2 = _t); (((t30_fields*)(z2+(0+t32_size+t78_size)))->_nextWaiting) = (t13) 0; NILCHECKA (z2 = _t); (((t30_fields*)(z2+(0+t32_size+t78_size)))->_waitingForCondition) = (t19) 0; _Thread__CanRun (_t); _limit -= 1 ; z3 = (_limit == 0 ); if (z3) { return; }; NILCHECKA (z1 = _c); z3 = ((((t31_fields*)(z1+(0+t78_size)))->_waitingForMe) != 0); } while (z3); } #line 293 } }; #line 296 "Thread.m3" EXPORT t80 _Thread__Alert (_t) t13 _t; { t13 z2; t13 z1; t17 z3; t17 z0; t19 z4; t13 z5; #line 296 "Thread.m3" { { CHECKSTACKOVERFLOW; _ThreadSup__inCritical += 1 ; NILCHECKA (z2 = _t); (((t30_fields*)(z2+(0+t32_size+t78_size)))->_alertPending) = 1 ; NILCHECKA (z1 = _t); z3 = ((((t30_fields*)(z1+(0+t32_size+t78_size)))->_state) == 1 ); z0 = 0; if (z3) { NILCHECKA (z2 = _t); #line 300 z0 = (((t30_fields*)(z2+(0+t32_size+t78_size)))->_alertable); }; if (z0) { { t19 *with; NILCHECKA (z1 = _t); with = &(((t30_fields*)(z1+(0+t32_size+t78_size)))->_waitingForCondition); { auto t19 * _c; #line 302 { _c = with; NILCHECKA (z4 = (*_c)); z3 = ((((t31_fields*)(z4+(0+t78_size)))->_waitingForMe) == _t); if (z3) { NILCHECKA (z1 = _t); NILCHECKA (z4 = (*_c)); (((t31_fields*)(z4+(0+t78_size)))->_waitingForMe) = (((t30_fields*)(z1+(0+t32_size+t78_size)))->_nextWaiting); #line 304 goto if_10_end; }; { { auto t13 _tt; { ZERO1 (& _tt); NILCHECKA (z4 = (*_c)); _tt = (((t31_fields*)(z4+(0+t78_size)))->_waitingForMe); NILCHECKA (z1 = _tt); z3 = ((((t30_fields*)(z1+(0+t32_size+t78_size)))->_nextWaiting) != _t); #line 307 if (z3) do { NILCHECKA (z1 = _tt); _tt = (((t30_fields*)(z1+(0+t32_size+t78_size)))->_nextWaiting); #line 307 NILCHECKA (z1 = _tt); z3 = ((((t30_fields*)(z1+(0+t32_size+t78_size)))->_nextWaiting) != _t); #line 307 } while (z3); NILCHECKA (z1 = _t); NILCHECKA (z5 = _tt); (((t30_fields*)(z5+(0+t32_size+t78_size)))->_nextWaiting) = (((t30_fields*)(z1+(0+t32_size+t78_size)))->_nextWaiting); #line 308 } } }; if_10_end: /**/; NILCHECKA (z2 = _t); (((t30_fields*)(z2+(0+t32_size+t78_size)))->_nextWaiting) = (t13) 0; NILCHECKA (z2 = _t); (((t30_fields*)(z2+(0+t32_size+t78_size)))->_waitingForCondition) = (t19) 0; } } }; _Thread__CanRun (_t); goto if_9_end; }; if_9_end: /**/; _ThreadSup__inCritical -= 1 ; } } }; #line 315 "Thread.m3" EXPORT t17 _Thread__TestAlert () { t13 z1; t13 z2; #line 315 "Thread.m3" { auto t17 _result; auto t17 __result; { ZERO1B (& _result); #line 315 ZERO1B (& __result); CHECKSTACKOVERFLOW; _ThreadSup__inCritical += 1 ; NILCHECKA (z1 = _ThreadSup__self); _result = (((t30_fields*)(z1+(0+t32_size+t78_size)))->_alertPending); NILCHECKA (z2 = _ThreadSup__self); (((t30_fields*)(z2+(0+t32_size+t78_size)))->_alertPending) = 0 ; _ThreadSup__inCritical -= 1 ; __result = _result; return __result; } } }; #line 326 "Thread.m3" EXPORT t80 _ThreadF__Shell () { t13 z1; t24 z2; t24 z0; t21 z3; t20 z4; t13 z5; t17 z6; t17 z7; t23 z8; t2 z9; t8 z10; #line 326 "Thread.m3" { { CHECKSTACKOVERFLOW; _ThreadSup__inCritical -= 1 ; _Thread__allow_sigprof (); NILCHECKA (z1 = _ThreadSup__self); NILCHECKA (z2 = (((t30_fields*)(z1+(0+t32_size+t78_size)))->_closure)); z0 = (*(char**)z2); #line 330 z3 = ((t24_methods*) (z0+(0+t78_msize)))->_apply; z4 = z3 (z2); NILCHECKA (z1 = _ThreadSup__self); (((t30_fields*)(z1+(0+t32_size+t78_size)))->_result) = z4; _ThreadSup__inCritical += 1 ; NILCHECKA (z1 = _ThreadSup__self); NILCHECKA (z5 = (((t30_fields*)(z1+(0+t32_size+t78_size)))->_next)); (((t30_fields*)(z5+(0+t32_size+t78_size)))->_previous) = (((t30_fields*)(z1+(0+t32_size+t78_size)))->_previous); NILCHECKA (z1 = _ThreadSup__self); NILCHECKA (z5 = (((t30_fields*)(z1+(0+t32_size+t78_size)))->_previous)); (((t30_fields*)(z5+(0+t32_size+t78_size)))->_next) = (((t30_fields*)(z1+(0+t32_size+t78_size)))->_next); NILCHECKA (z5 = _ThreadSup__self); (((t30_fields*)(z5+(0+t32_size+t78_size)))->_previous) = (t13) 0; NILCHECKA (z5 = _ThreadSup__self); (((t30_fields*)(z5+(0+t32_size+t78_size)))->_next) = (t13) 0; z6 = (_Thread__stackPoolSize < 2001 ); z7 = 0; if (z6) { NILCHECKA (z1 = _ThreadSup__self); NILCHECKB (z9 = (((t30_fields*)(z1+(0+t32_size+t78_size)))->_stack)); #line 336 z8 = (*((t3*) z9)).size[0]; z6 = (z8 == 3000 ); z7 = z6; }; if (z7) { NILCHECKA (z1 = _ThreadSup__self); z10 = _Thread__stackPoolSize; if ((z10 < 0) || (2000 < z10)) RANGEFAULT; (_Thread__stackPool.elts[z10]) = (((t30_fields*)(z1+(0+t32_size+t78_size)))->_stack); _Thread__stackPoolSize += 1 ; goto if_11_end; }; NILCHECKA (z1 = _ThreadSup__self); UVDISPOSE(& (((t30_fields*)(z1+(0+t32_size+t78_size)))->_stack)); if_11_end: /**/; z6 = (_Thread__contextPoolSize < 2001 ); if (z6) { NILCHECKA (z1 = _ThreadSup__self); z10 = _Thread__contextPoolSize; if ((z10 < 0) || (2000 < z10)) RANGEFAULT; (_Thread__contextPool.elts[z10]) = (((t30_fields*)(z1+(0+t32_size+t78_size)))->_context); _Thread__contextPoolSize += 1 ; goto if_12_end; }; NILCHECKA (z1 = _ThreadSup__self); UVDISPOSE(& (((t30_fields*)(z1+(0+t32_size+t78_size)))->_context)); if_12_end: /**/; NILCHECKA (z5 = _ThreadSup__self); _Thread__Broadcast ((((t30_fields*)(z5+(0+t32_size+t78_size)))->_endCondition)); _Thread__ICannotRun ( 4 ); _Thread__Yield (); } } }; #line 352 "Thread.m3" EXPORT t80 _Thread__Yield () { t13 z1; t17 z3; t17 z0; t17 z2; t13 z4; t2 z5; t8 z6; t8 z7; t14 z8; t4 z9; t4 z10; #line 352 "Thread.m3" { auto t13 _t; { ZERO1 (& _t); #line 352 CHECKSTACKOVERFLOW; loop_0:; _t = _ThreadSup__self; do { NILCHECKA (z1 = _t); _t = (((t30_fields*)(z1+(0+t32_size+t78_size)))->_nextRunning); NILCHECKA (z1 = _t); z3 = ((((t30_fields*)(z1+(0+t32_size+t78_size)))->_state) == 0 ); #line 359 z0 = 1; if (! z3) { z3 = (_t == _ThreadSup__self); z0 = z3; }; } while (! z0); NILCHECKA (z1 = _t); z3 = ((((t30_fields*)(z1+(0+t32_size+t78_size)))->_state) == 0 ); if (z3) { z2 = (_t != _ThreadSup__self); if (z2) { _Thread__disallow_sigprof (); NILCHECKA (z4 = _t); NILCHECKB (z5 = (((t30_fields*)(z4+(0+t32_size+t78_size)))->_context)); { register t39* array = & (*((t3*) z5)); #line 365 z7 = 0 ; if (z7 >= (array->size[0])) RANGEFAULT; z6 = (int)(array->elts + (z7 * 4)); }; z8 = (char*)(& (*(t8*)z6)); #line 365 Transfer (z8); _Thread__allow_sigprof (); goto if_14_end; }; if_14_end: /**/; _ThreadSup__inCritical -= 1 ; return; }; z2 = (_Thread__pausedThreads != 0); if (z2) { NILCHECKA (z4 = _Thread__pausedThreads); _Time__Now (&z9); _Time__Subtract ((((t30_fields*)(z4+(0+t32_size+t78_size)))->_waitingForTime), z9, &z10); #line 375 _Thread__DelayProfTimer (z10); goto if_13_end; }; exit ( 0 ); if_13_end: /**/; goto loop_0; } } }; #line 386 "Thread.m3" EXPORT t80 _Thread__Acquire (_m) t16 _m; { t16 z1; t17 z3; t16 z2; t13 z4; #line 386 "Thread.m3" { { CHECKSTACKOVERFLOW; loop_1:; _ThreadSup__inCritical += 1 ; NILCHECKA (z1 = _m); z3 = ((((t32_fields*)(z1+(0+t78_size)))->_sem) == 0 ); if (z3) { NILCHECKA (z2 = _m); (((t32_fields*)(z2+(0+t78_size)))->_sem) = 1 ; _ThreadSup__inCritical -= 1 ; return; }; _Thread__ICannotRun ( 2 ); NILCHECKA (z1 = _m); NILCHECKA (z4 = _ThreadSup__self); (((t30_fields*)(z4+(0+t32_size+t78_size)))->_nextWaiting) = (((t32_fields*)(z1+(0+t78_size)))->_waitingForMe); NILCHECKA (z2 = _m); (((t32_fields*)(z2+(0+t78_size)))->_waitingForMe) = _ThreadSup__self; _Thread__Yield (); goto loop_1; } } }; #line 401 "Thread.m3" EXPORT t80 _Thread__Release (_m) t16 _m; { t16 z2; t16 z1; t17 z3; t13 z4; #line 401 "Thread.m3" { auto t13 _t; { ZERO1 (& _t); #line 401 CHECKSTACKOVERFLOW; _ThreadSup__inCritical += 1 ; NILCHECKA (z2 = _m); (((t32_fields*)(z2+(0+t78_size)))->_sem) = 0 ; NILCHECKA (z1 = _m); z3 = ((((t32_fields*)(z1+(0+t78_size)))->_waitingForMe) != 0); if (z3) do { NILCHECKA (z1 = _m); _t = (((t32_fields*)(z1+(0+t78_size)))->_waitingForMe); NILCHECKA (z4 = _t); NILCHECKA (z2 = _m); (((t32_fields*)(z2+(0+t78_size)))->_waitingForMe) = (((t30_fields*)(z4+(0+t32_size+t78_size)))->_nextWaiting); NILCHECKA (z4 = _t); (((t30_fields*)(z4+(0+t32_size+t78_size)))->_nextWaiting) = (t13) 0; _Thread__CanRun (_t); NILCHECKA (z1 = _m); z3 = ((((t32_fields*)(z1+(0+t78_size)))->_waitingForMe) != 0); } while (z3); _ThreadSup__inCritical -= 1 ; } } }; #line 415 "Thread.m3" EXPORT t13 _Thread__Self () { #line 415 "Thread.m3" { auto t13 __result; { ZERO1 (& __result); CHECKSTACKOVERFLOW; __result = _ThreadSup__self; return __result; } } }; #line 420 "Thread.m3" EXPORT t80 _ThreadF__ProcessStacks (_p) t5 _p; { t13 z1; t17 z2; t13 z3; t2 z4; t8 z5; t8 z6; t14 z7; #line 420 "Thread.m3" { auto t13 _t; auto t14 _start; auto t14 _stop; { ZERO1 (& _t); #line 420 CHECKSTACKOVERFLOW; SelfTos (&_start, &_stop); { t5 proc = _p; if (!IS_CLOSURE(proc)) { proc (_start, _stop); } else { ((t5) CLOSURE_PROC(proc)) (CLOSURE_FRAME(proc), _start, _stop); #line 426 }; }; NILCHECKA (z1 = _ThreadSup__self); _t = (((t30_fields*)(z1+(0+t32_size+t78_size)))->_next); z2 = (_t != _ThreadSup__self); if (z2) do { NILCHECKA (z3 = _t); NILCHECKB (z4 = (((t30_fields*)(z3+(0+t32_size+t78_size)))->_context)); { register t39* array = & (*((t3*) z4)); #line 429 z6 = 0 ; if (z6 >= (array->size[0])) RANGEFAULT; z5 = (int)(array->elts + (z6 * 4)); }; z7 = (char*)(& (*(t8*)z5)); #line 429 Tos (z7, &_start, &_stop); { t5 proc = _p; if (!IS_CLOSURE(proc)) { proc (_start, _stop); } else { ((t5) CLOSURE_PROC(proc)) (CLOSURE_FRAME(proc), _start, _stop); #line 430 }; }; NILCHECKA (z1 = _t); _t = (((t30_fields*)(z1+(0+t32_size+t78_size)))->_next); z2 = (_t != _ThreadSup__self); } while (z2); #line 431 } } }; #line 434 "Thread.m3" EXPORT t80 _ThreadF__Pause (_until) t4 _until; { t13 z2; t17 z3; t17 z0; t13 z4; t75 z5; t13 z1; #line 434 "Thread.m3" { auto t13 _t; auto t13 _u; { ZERO1 (& _t); ZERO1 (& _u); #line 434 CHECKSTACKOVERFLOW; _ThreadSup__inCritical += 1 ; NILCHECKA (z2 = _ThreadSup__self); (((t30_fields*)(z2+(0+t32_size+t78_size)))->_waitingForTime) = _until; _t = _Thread__pausedThreads; _u = (t13) 0; z3 = (_t != 0); z0 = 0; if (z3) { NILCHECKA (z4 = _t); z5 = _Time__Compare ((((t30_fields*)(z4+(0+t32_size+t78_size)))->_waitingForTime), _until); #line 442 z3 = (z5 < 0 ); z0 = z3; }; if (z0) do { _u = _t; NILCHECKA (z1 = _t); _t = (((t30_fields*)(z1+(0+t32_size+t78_size)))->_nextWaiting); z3 = (_t != 0); z0 = 0; if (z3) { #line 444 NILCHECKA (z4 = _t); z5 = _Time__Compare ((((t30_fields*)(z4+(0+t32_size+t78_size)))->_waitingForTime), _until); #line 444 z3 = (z5 < 0 ); z0 = z3; }; } while (z0); z3 = (_u == 0); if (z3) { NILCHECKA (z2 = _ThreadSup__self); (((t30_fields*)(z2+(0+t32_size+t78_size)))->_nextWaiting) = _Thread__pausedThreads; _Thread__pausedThreads = _ThreadSup__self; goto if_16_end; }; NILCHECKA (z2 = _ThreadSup__self); (((t30_fields*)(z2+(0+t32_size+t78_size)))->_nextWaiting) = _t; NILCHECKA (z2 = _u); (((t30_fields*)(z2+(0+t32_size+t78_size)))->_nextWaiting) = _ThreadSup__self; if_16_end: /**/; _Thread__ICannotRun ( 3 ); _Thread__Yield (); } } }; #line 456 "Thread.m3" PRIVATE t80 _Thread__ResumeScheduling (_sig, _code, _scp) t8 _sig; t8 _code; t11 _scp; { t8 z4; t17 z1; #line 456 "Thread.m3" { auto t10 _it; auto t10 _oit; { CHECKSTACKOVERFLOW; ((_it._it_interval)._tv_sec) = 0 ; ((_it._it_interval)._tv_usec) = 0 ; ((_it._it_value)._tv_sec) = 0 ; ((_it._it_value)._tv_usec) = 0 ; z4 = setitimer ( 0 , &_it, &_oit); z1 = (z4 != 0 ); if (z1) { RAISE (& _Thread__InternalError, 0, 0); }; } } }; #line 473 "Thread.m3" PRIVATE t80 _Thread__StartSwitching () { t5 z1; t8 z4; t17 z2; #line 473 "Thread.m3" { auto t10 _it; auto t10 _oit; auto t9 _sv; auto t9 _osv; { ZERO3 (& _sv); ZERO3 (& _osv); #line 473 CHECKSTACKOVERFLOW; z1 = _Thread__switch_thread; if (IS_CLOSURE (z1)) NARROWFAULT; (_sv._sv_handler) = z1; (_sv._sv_mask) = 0 ; (_sv._sv_flags) = 0 ; z4 = sigvec ( 34 , &_sv, &_osv); z2 = (z4 != 0 ); if (z2) { RAISE (& _Thread__InternalError, 0, 0); }; ((_it._it_interval)._tv_sec) = (_Thread__selected_interval._tv_sec); ((_it._it_interval)._tv_usec) = (_Thread__selected_interval._tv_usec); ((_it._it_value)._tv_sec) = (_Thread__selected_interval._tv_sec); ((_it._it_value)._tv_usec) = (_Thread__selected_interval._tv_usec); z4 = setitimer ( 1 , &_it, &_oit); z2 = (z4 != 0 ); if (z2) { RAISE (& _Thread__InternalError, 0, 0); }; _Thread__allow_sigprof (); } } }; #line 497 "Thread.m3" PRIVATE t80 _Thread__switch_thread (_sig, _code, _scp) t8 _sig; t8 _code; t11 _scp; { t17 z2; #line 497 "Thread.m3" { { CHECKSTACKOVERFLOW; _Thread__allow_sigprof (); z2 = (_ThreadSup__inCritical == 0 ); if (z2) { _ThreadSup__inCritical += 1 ; _Thread__Yield (); goto if_20_end; }; if_20_end: /**/; } } }; #line 507 "Thread.m3" PRIVATE t80 _Thread__allow_sigprof () { t8 z2; t8 z3; t8 z1; #line 507 "Thread.m3" { auto t8 _i; { CHECKSTACKOVERFLOW; z2 = sigsetmask ( 0 ); _i = z2; z3 = _CoreOS__sigmask ( 34 ); z1 = ~ z3; z2 = _i & z1; _i = z2; z2 = sigsetmask (_i); } } }; #line 515 "Thread.m3" PRIVATE t80 _Thread__disallow_sigprof () { t8 z2; t8 z3; t8 z1; #line 515 "Thread.m3" { auto t8 _i; { CHECKSTACKOVERFLOW; z2 = sigsetmask ( 0 ); _i = z2; z3 = _CoreOS__sigmask ( 34 ); z1 = _i | z3; _i = z1; z2 = sigsetmask (_i); } } }; #line 525 "Thread.m3" PRIVATE t80 _Thread__DelayProfTimer (_t) t4 _t; { t17 z3; t17 z0; t17 z4; t17 z1; t17 z5; t5 z2; t8 z6; t8 z7; t13 z8; t75 z9; #line 525 "Thread.m3" { auto t10 _it; auto t10 _oit; auto t9 _sv; auto t9 _osv; auto t8 _i; { ZERO3 (& _sv); ZERO3 (& _osv); #line 525 CHECKSTACKOVERFLOW; z3 = ((_t._seconds) > 0 ); z0 = 1; if (! z3) { z4 = ((_t._seconds) == 0 ); z1 = 0; if (z4) { z5 = ((_t._microseconds) > 0 ); #line 531 z1 = z5; }; z0 = z1; }; if (z0) { z2 = _Thread__ResumeScheduling; if (IS_CLOSURE (z2)) NARROWFAULT; (_sv._sv_handler) = z2; (_sv._sv_mask) = 0 ; z6 = sigvec ( 14 , &_sv, &_osv); ((_it._it_value)._tv_sec) = (_t._seconds); ((_it._it_value)._tv_usec) = (_t._microseconds); ((_it._it_interval)._tv_sec) = 0 ; ((_it._it_interval)._tv_usec) = 10000 ; z6 = sigsetmask ( 0 ); _i = z6; z6 = _CoreOS__sigmask ( 14 ); z7 = _i | z6; _i = z7; z6 = sigsetmask (_i); z1 = (z6 != 0 ); if (z1) { RAISE (& _Thread__InternalError, 0, 0); }; z6 = setitimer ( 0 , &_it, &_oit); z1 = (z6 != 0 ); if (z1) { RAISE (& _Thread__InternalError, 0, 0); }; z6 = sigpause ( 0 ); goto if_21_end; }; if_21_end: /**/; z3 = (_Thread__pausedThreads != 0); if (z3) { { { auto t13 _t; auto t7 _tv; auto t6 _tz; { ZERO1 (& _t); _t = _Thread__pausedThreads; z6 = gettimeofday (&_tv, &_tz); z1 = (z6 != 0 ); if (z1) { RAISE (& _Thread__InternalError, 0, 0); }; z3 = (_t != 0); z0 = 0; if (z3) { NILCHECKA (z8 = _t); z9 = _Time__Compare ((((t30_fields*)(z8+(0+t32_size+t78_size)))->_waitingForTime), (*((t4*)(& _tv)))); #line 559 z3 = (z9 <= 0 ); z0 = z3; }; if (z0) do { _Thread__CanRun (_t); NILCHECKA (z8 = _t); _Thread__pausedThreads = (((t30_fields*)(z8+(0+t32_size+t78_size)))->_nextWaiting); NILCHECKA (z8 = _t); (((t30_fields*)(z8+(0+t32_size+t78_size)))->_nextWaiting) = (t13) 0; _t = _Thread__pausedThreads; z3 = (_t != 0); z0 = 0; if (z3) { NILCHECKA (z8 = _t); z9 = _Time__Compare ((((t30_fields*)(z8+(0+t32_size+t78_size)))->_waitingForTime), (*((t4*)(& _tv)))); #line 564 z3 = (z9 <= 0 ); z0 = z3; }; } while (z0); } } }; goto if_24_end; }; if_24_end: /**/; } } }; #line 569 "Thread.m3" EXPORT t80 _ThreadF__SetSwitchingInterval (_i) t4 _i; { #line 569 "Thread.m3" { { CHECKSTACKOVERFLOW; (_Thread__selected_interval._tv_sec) = (_i._seconds); (_Thread__selected_interval._tv_usec) = (_i._microseconds); if (_Thread__multipleThreads) { _Thread__StartSwitching (); goto if_26_end; }; if_26_end: /**/; } } }; PRIVATE int init_done = -1; #line 590 "Thread.m3" PRIVATE void Thread__initProc (g) int g; { t7 z0; t13 z1; t2 z2; t13 z3; t2 z4; t8 z5; t8 z6; t14 z7; #line 590 "Thread.m3" if (init_done >= g) return; init_done = g; INITIALIZE (& ThreadF__init); INITIALIZE (& Thread__init); INITIALIZE (& ThreadSup__init); #line 590 INITIALIZE (& Cstdlib__init); INITIALIZE (& CoreOS__init); INITIALIZE (& Time__init); INITIALIZE (& Word__init); #line 98 ZERO1B (& _Thread__multipleThreads); ZERO1 (& _Thread__topThread); ZERO1 (& _Thread__pausedThreads); #line 98 ZERO1B ((& _Thread__multipleThreads)); z0._tv_sec = 0 ; z0._tv_usec = 100000 ; _Thread__selected_interval = z0; ZERO (8004, (& _Thread__stackPool)); ZERO1 ((& _Thread__stackPoolSize)); ZERO (8004, (& _Thread__contextPool)); ZERO1 ((& _Thread__contextPoolSize)); #line 580 { register char** ptr = (char**) TNEWOBJ (TC13); ((t30_fields*)((char*)ptr + (0+t32_size+t78_size)))->_state = 0 ; ((t30_fields*)((char*)ptr + (0+t32_size+t78_size)))->_alertPending = 0 ; #line 580 z1 = (t13) ptr; }; _Thread__topThread = z1; { register t39* ptr; int sz[1]; sz[0] = contextSize; ptr = (t39*) UNEWA(TC2, 8 + sz[0] * 4); ptr->elts = (char*)(& ptr->size[1]); #line 581 ptr->size[0] = sz[0]; z2 = (t2) ptr; }; NILCHECKA (z1 = _Thread__topThread); (((t30_fields*)(z1+(0+t32_size+t78_size)))->_context) = z2; NILCHECKA (z3 = _Thread__topThread); NILCHECKB (z4 = (((t30_fields*)(z3+(0+t32_size+t78_size)))->_context)); { register t39* array = & (*((t3*) z4)); #line 582 z6 = 0 ; if (z6 >= (array->size[0])) RANGEFAULT; z5 = (int)(array->elts + (z6 * 4)); }; z7 = (char*)(& (*(t8*)z5)); InitTopContext (_Thread__topThread, z7); _ThreadSup__self = _Thread__topThread; _Thread__pausedThreads = (t13) 0; NILCHECKA (z3 = _Thread__topThread); (((t30_fields*)(z3+(0+t32_size+t78_size)))->_nextRunning) = _Thread__topThread; NILCHECKA (z3 = _Thread__topThread); (((t30_fields*)(z3+(0+t32_size+t78_size)))->_previousRunning) = _Thread__topThread; NILCHECKA (z3 = _Thread__topThread); (((t30_fields*)(z3+(0+t32_size+t78_size)))->_next) = _Thread__topThread; NILCHECKA (z3 = _Thread__topThread); (((t30_fields*)(z3+(0+t32_size+t78_size)))->_previous) = _Thread__topThread; return; #line 590 }; #line 590 "Thread.m3" PRIVATE void t2_PrintProc (ref) t3* ref; { CHECKSTACKOVERFLOW; fprintf (stderr, "%s {", TC2->brand); fprintf (stderr, "^ = array"); #line 590 fprintf (stderr, "}\n"); }; #line 590 "Thread.m3" PRIVATE void t11_PrintProc (ref) t12* ref; { CHECKSTACKOVERFLOW; fprintf (stderr, "%s {", TC11->brand); fprintf (stderr, "^ = { "); #line 590 fprintf (stderr, "sc_onstack = %d", (*ref)._sc_onstack); fprintf (stderr, "sc_mask = %d", (*ref)._sc_mask); fprintf (stderr, "sc_sp = %d", (*ref)._sc_sp); #line 590 fprintf (stderr, "sc_pc = %d", (*ref)._sc_pc); fprintf (stderr, "sc_ps = %d", (*ref)._sc_ps); fprintf (stderr, "}"); fprintf (stderr, "}\n"); #line 590 }; #line 590 "Thread.m3" PRIVATE void t30_InitProc (obj) char* obj; { register t30_fields* p; #line 590 "Thread.m3" CHECKSTACKOVERFLOW; p = (t30_fields*) (obj + TC16->datasize); }; #line 590 "Thread.m3" PRIVATE void t30_SetupProc () { register int* p; #line 590 "Thread.m3" t30_TC.datasize += TC16->datasize; t30_TC.methodsize += TC16->methodsize; p = (int*) UALLOC (t30_TC.methodsize); COPY (TC16->defaultMethods, p, (TC16->methodsize)); #line 590 p[0] = (int)(& t30_TC); p[1] = 0; t30_TC.defaultMethods = (char*) p; }; #line 590 "Thread.m3" PRIVATE void t30_PrintProc (obj) char *obj; { t30_fields* o; #line 590 "Thread.m3" CHECKSTACKOVERFLOW; if (TC16->printProc != 0) {TC16->printProc (obj); } fprintf (stderr, "{%s} ", TC30->brand); o = (t30_fields*) (obj + TC16->datasize); #line 590 fprintf (stderr, "state = %d", o->_state); fprintf (stderr, ", "); fprintf (stderr, "closure = %#x", o->_closure); fprintf (stderr, ", "); #line 590 fprintf (stderr, "result = %#x", o->_result); fprintf (stderr, ", "); fprintf (stderr, "stack = %#x", o->_stack); fprintf (stderr, ", "); #line 590 fprintf (stderr, "context = %#x", o->_context); fprintf (stderr, ", "); fprintf (stderr, "previous = %#x", o->_previous); #line 590 fprintf (stderr, ", "); fprintf (stderr, "next = %#x", o->_next); fprintf (stderr, ", "); fprintf (stderr, "nextRunning = %#x", o->_nextRunning); #line 590 fprintf (stderr, ", "); fprintf (stderr, "previousRunning = %#x", o->_previousRunning); fprintf (stderr, ", "); fprintf (stderr, "nextWaiting = %#x", o->_nextWaiting); #line 590 fprintf (stderr, ", "); fprintf (stderr, "waitingForCondition = %#x", o->_waitingForCondition); fprintf (stderr, ", "); fprintf (stderr, "waitingForTime = { "); #line 590 fprintf (stderr, "seconds = %d", o->_waitingForTime._seconds); fprintf (stderr, "microseconds = %d", o->_waitingForTime._microseconds); #line 590 fprintf (stderr, "}"); fprintf (stderr, ", "); fprintf (stderr, "alertable = %d", o->_alertable); fprintf (stderr, ", "); #line 590 fprintf (stderr, "alertPending = %d", o->_alertPending); fprintf (stderr, ", "); fprintf (stderr, "endCondition = %#x", o->_endCondition); #line 590 }; #line 590 "Thread.m3" PRIVATE void t31_InitProc (obj) char* obj; { register t31_fields* p; #line 590 "Thread.m3" CHECKSTACKOVERFLOW; p = (t31_fields*) (obj + TC78->datasize); }; #line 590 "Thread.m3" PRIVATE void t31_SetupProc () { register int* p; #line 590 "Thread.m3" t31_TC.datasize += TC78->datasize; t31_TC.methodsize += TC78->methodsize; p = (int*) UALLOC (t31_TC.methodsize); COPY (TC78->defaultMethods, p, (TC78->methodsize)); #line 590 p[0] = (int)(& t31_TC); p[1] = 0; t31_TC.defaultMethods = (char*) p; }; #line 590 "Thread.m3" PRIVATE void t31_PrintProc (obj) char *obj; { t31_fields* o; #line 590 "Thread.m3" CHECKSTACKOVERFLOW; if (TC78->printProc != 0) {TC78->printProc (obj); } fprintf (stderr, "{%s} ", TC31->brand); o = (t31_fields*) (obj + TC78->datasize); #line 590 fprintf (stderr, "waitingForMe = %#x", o->_waitingForMe); }; #line 590 "Thread.m3" PRIVATE void t32_InitProc (obj) char* obj; { register t32_fields* p; #line 590 "Thread.m3" CHECKSTACKOVERFLOW; p = (t32_fields*) (obj + TC78->datasize); }; #line 590 "Thread.m3" PRIVATE void t32_SetupProc () { register int* p; #line 590 "Thread.m3" t32_TC.datasize += TC78->datasize; t32_TC.methodsize += TC78->methodsize; p = (int*) UALLOC (t32_TC.methodsize); COPY (TC78->defaultMethods, p, (TC78->methodsize)); #line 590 p[0] = (int)(& t32_TC); p[1] = 0; t32_TC.defaultMethods = (char*) p; }; #line 590 "Thread.m3" PRIVATE void t32_PrintProc (obj) char *obj; { t32_fields* o; #line 590 "Thread.m3" CHECKSTACKOVERFLOW; if (TC78->printProc != 0) {TC78->printProc (obj); } fprintf (stderr, "{%s} ", TC32->brand); o = (t32_fields*) (obj + TC78->datasize); #line 590 fprintf (stderr, "sem = %d", o->_sem); fprintf (stderr, ", "); fprintf (stderr, "waitingForMe = %#x", o->_waitingForMe); }; #line 590 PRIVATE void t30_MapProc (p, r, c) void (*p) (); char* r; ADDRESS c; { register t30_fields* o; CHECKSTACKOVERFLOW; t16_MapProc (p, r, c); #line 590 o = (t30_fields*) (r + TC16->datasize); p (& (o->_closure), r, c); p (& (o->_result), r, c); p (& (o->_previous), r, c); p (& (o->_next), r, c); #line 590 p (& (o->_nextRunning), r, c); p (& (o->_previousRunning), r, c); p (& (o->_nextWaiting), r, c); p (& (o->_waitingForCondition), r, c); #line 590 p (& (o->_endCondition), r, c); }; PRIVATE void t31_MapProc (p, r, c) void (*p) (); char* r; ADDRESS c; { register t31_fields* o; #line 590 CHECKSTACKOVERFLOW; t78_MapProc (p, r, c); o = (t31_fields*) (r + TC78->datasize); p (& (o->_waitingForMe), r, c); }; PRIVATE void t32_MapProc (p, r, c) #line 590 void (*p) (); char* r; ADDRESS c; { register t32_fields* o; CHECKSTACKOVERFLOW; t78_MapProc (p, r, c); o = (t32_fields*) (r + TC78->datasize); #line 590 p (& (o->_waitingForMe), r, c); }; PRIVATE INITLINK me_0 ={(INITLINK*)NIL, 0, Thread__initProc}; PRIVATE INITLINK me_1 ={(INITLINK*)NIL, 0, Thread__initProc}; static char* VSimports[] = { &VS_ThreadSup__self__d8ab6afe2b3c018a, &VS_ThreadSup__inCritical__651d6d3526469249, &VS_Ctypes__const_char_star__81d35d212987031d, &VS_Ctypes__char_star__90cf39683847e5e8, &VS_Ctypes__char_star__90cf39683847e5e8, &VS_CoreOS__ITIMER_REAL__7e8ed4a129003c6c, &VS_CoreOS__ITIMER_VIRTUAL__82f12a953a44a467, &VS_CoreOS__SIGALRM__048d5d6725482abf, &VS_CoreOS__SIGVTALRM__c9e8638924c06f0d, &VS_CoreOS__sigmask__3ebfaf72317836e8, &VS_Thread__Alerted__fc88feb43485af46, &VS_Time__Now__1cf048602fe0a57c, &VS_Time__Subtract__a5e6bd09359aa50f, &VS_Time__Compare__9a4ce2942f11a212, &VS_Time__NoPrivileges__6cb57575330ad093, &VS_Word__And__479727d22e0cef9f, &VS_Word__Or__6e0e049826e116f7, &VS_Word__Not__e5602ba93e6fe1e1, &VS_Thread__DefaultStackSize__0c949e2e2def4e40, &VS_Thread__T__2555b70b3f7780b1, &VS_Thread__Mutex__4f5c12072cdeec3e, &VS_Thread__Condition__26d5968239e08f4e, &VS_Thread__Closure__7fb5c6232c5a658a, &VS_Thread__SizedClosure__8a46717d2eae7b07, &VS_Thread__Alerted__fc88feb43485af46, &VS_ThreadSup__inCritical__651d6d3526469249, &VS_ThreadSup__self__d8ab6afe2b3c018a, NIL }; void Thread__MLink (phase) int phase; { switch (phase) { case 0: { me_0.link = ThreadF__init; ThreadF__init = & me_0; me_1.link = Thread__init; Thread__init = & me_1; t2_TC = t2_TC_init; REGISTERTYPE (TC2); t11_TC = t11_TC_init; REGISTERTYPE (TC11); t30_TC = t30_TC_init; REGISTERTYPE (TC30); t31_TC = t31_TC_init; REGISTERTYPE (TC31); t32_TC = t32_TC_init; REGISTERTYPE (TC32); break; }; case 1: { t30_TC.parent = TC_MUTEX; t31_TC.parent = TC_ROOT; t32_TC.parent = TC_ROOT; #line 53 "Thread.m3" IDENTIFYTYPES (TC13, TC30); #line 48 IDENTIFYTYPES (TC19, TC31); #line 39 IDENTIFYTYPES (TC16, TC32); break; }; case 2: { break; }; }; };