Changeset 210b8b3
- Timestamp:
- Mar 23, 2020, 6:15:33 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- ae66348
- Parents:
- 3a3b2b9
- Location:
- libcfa/src/concurrency
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/invoke.h
r3a3b2b9 r210b8b3 119 119 }; 120 120 121 static inline struct __stack_t * __get_stack( struct $coroutine * cor ) { return (struct __stack_t*)(((uintptr_t)cor->stack.storage) & ((uintptr_t)-2)); } 122 121 123 // struct which calls the monitor is accepting 122 124 struct __waitfor_mask_t { -
libcfa/src/concurrency/kernel.cfa
r3a3b2b9 r210b8b3 344 344 345 345 /* paranoid */ verify( ! kernelTLS.preemption_state.enabled ); 346 /* paranoid */ verifyf( ((uintptr_t)thrd_dst->context.SP) < ((uintptr_t)__get_stack(thrd_dst->curr_cor)->base ) || thrd_dst->curr_cor == proc_cor, "ERROR : Destination $thread %p has been corrupted.\n StackPointer too small.\n", thrd_dst ); // add escape condition if we are setting up the processor 347 /* paranoid */ verifyf( ((uintptr_t)thrd_dst->context.SP) > ((uintptr_t)__get_stack(thrd_dst->curr_cor)->limit) || thrd_dst->curr_cor == proc_cor, "ERROR : Destination $thread %p has been corrupted.\n StackPointer too large.\n", thrd_dst ); // add escape condition if we are setting up the processor 346 348 347 349 // set context switch to the thread that the processor is executing … … 350 352 // when __cfactx_switch returns we are back in the processor coroutine 351 353 354 /* paranoid */ verifyf( ((uintptr_t)thrd_dst->context.SP) > ((uintptr_t)__get_stack(thrd_dst->curr_cor)->limit), "ERROR : Destination $thread %p has been corrupted.\n StackPointer too large.\n", thrd_dst ); 355 /* paranoid */ verifyf( ((uintptr_t)thrd_dst->context.SP) < ((uintptr_t)__get_stack(thrd_dst->curr_cor)->base ), "ERROR : Destination $thread %p has been corrupted.\n StackPointer too small.\n", thrd_dst ); 352 356 /* paranoid */ verify( ! kernelTLS.preemption_state.enabled ); 353 357 … … 418 422 419 423 /* paranoid */ verify( ! kernelTLS.preemption_state.enabled ); 424 /* paranoid */ verifyf( ((uintptr_t)thrd_src->context.SP) < ((uintptr_t)__get_stack(thrd_src->curr_cor)->base ), "ERROR : Returning $thread %p has been corrupted.\n StackPointer too small.\n", thrd_src ); 425 /* paranoid */ verifyf( ((uintptr_t)thrd_src->context.SP) > ((uintptr_t)__get_stack(thrd_src->curr_cor)->limit), "ERROR : Returning $thread %p has been corrupted.\n StackPointer too large.\n", thrd_src ); 420 426 } 421 427 … … 764 770 // Destroy the main processor and its context in reverse order of construction 765 771 // These were manually constructed so we need manually destroy them 766 ^(mainProcessor->runner){}; 767 ^(mainProcessor){}; 772 ^(*mainProcessor){}; 768 773 769 774 // Final step, destroy the main thread since it is no longer needed 770 775 // Since we provided a stack to this taxk it will not destroy anything 771 ^(mainThread){}; 776 /* paranoid */ verify(mainThread->self_cor.stack.storage == (__stack_t*)(((uintptr_t)&storage_mainThreadCtx)| 0x1)); 777 ^(*mainThread){}; 772 778 773 779 ^(__cfa_dbg_global_clusters.list){};
Note: See TracChangeset
for help on using the changeset viewer.