Changeset f7d6bb0
- Timestamp:
- Jan 25, 2018, 1:00:06 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 6e0f4bd
- Parents:
- 81e1f32
- Location:
- src/libcfa/concurrency
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/invoke.h
r81e1f32 rf7d6bb0 134 134 // instrusive link field for threads 135 135 struct thread_desc * next; 136 137 __cfaabi_dbg_debug_do( 138 // instrusive link field for debugging 139 struct thread_desc * dbg_next; 140 struct thread_desc * dbg_prev; 141 ) 136 142 }; 137 143 -
src/libcfa/concurrency/kernel.c
r81e1f32 rf7d6bb0 609 609 } 610 610 611 //----------------------------------------------------------------------------- 612 // Debug 613 __cfaabi_dbg_debug_do( 614 struct { 615 thread_desc * tail; 616 } __cfaabi_dbg_thread_list = { NULL }; 617 618 void __cfaabi_dbg_thread_register( thread_desc * thrd ) { 619 if( !__cfaabi_dbg_thread_list.tail ) { 620 __cfaabi_dbg_thread_list.tail = thrd; 621 return; 622 } 623 __cfaabi_dbg_thread_list.tail->dbg_next = thrd; 624 thrd->dbg_prev = __cfaabi_dbg_thread_list.tail; 625 __cfaabi_dbg_thread_list.tail = thrd; 626 } 627 628 void __cfaabi_dbg_thread_unregister( thread_desc * thrd ) { 629 thread_desc * prev = thrd->dbg_prev; 630 thread_desc * next = thrd->dbg_next; 631 632 if( next ) { next->dbg_prev = prev; } 633 else { 634 assert( __cfaabi_dbg_thread_list.tail == thrd ); 635 __cfaabi_dbg_thread_list.tail = prev; 636 } 637 638 if( prev ) { prev->dbg_next = next; } 639 640 thrd->dbg_prev = NULL; 641 thrd->dbg_next = NULL; 642 } 643 ) 611 644 // Local Variables: // 612 645 // mode: c // -
src/libcfa/concurrency/kernel_private.h
r81e1f32 rf7d6bb0 85 85 extern void ThreadCtxSwitch(coroutine_desc * src, coroutine_desc * dst); 86 86 87 __cfaabi_dbg_debug_do( 88 extern void __cfaabi_dbg_thread_register ( thread_desc * thrd ); 89 extern void __cfaabi_dbg_thread_unregister( thread_desc * thrd ); 90 ) 91 87 92 //----------------------------------------------------------------------------- 88 93 // Utils -
src/libcfa/concurrency/thread.c
r81e1f32 rf7d6bb0 33 33 void ?{}(thread_desc& this) { 34 34 (this.self_cor){}; 35 this.self_cor.name = "Anonymous Coroutine";35 this.self_cor.name = "Anonymous Thread"; 36 36 this.self_mon.owner = &this; 37 37 this.self_mon.recursion = 1; 38 38 this.self_mon_p = &this.self_mon; 39 39 this.next = NULL; 40 __cfaabi_dbg_debug_do( 41 this.dbg_next = NULL; 42 this.dbg_prev = NULL; 43 __cfaabi_dbg_thread_register(&this); 44 ) 40 45 41 46 (this.monitors){ &this.self_mon_p, 1, (fptr_t)0 }; … … 43 48 44 49 void ^?{}(thread_desc& this) { 50 __cfaabi_dbg_debug_do( 51 __cfaabi_dbg_thread_unregister(&this); 52 ) 45 53 ^(this.self_cor){}; 46 54 }
Note: See TracChangeset
for help on using the changeset viewer.