Changeset 633a642 for src/libcfa/concurrency/thread.c
- Timestamp:
- Jan 30, 2018, 4:52:54 PM (6 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:
- 1449d83, 5ff188f
- Parents:
- 320eb73a (diff), 7416d46a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/thread.c
r320eb73a r633a642 31 31 // Thread ctors and dtors 32 32 33 void ?{}(thread_desc& this) {34 (this.self_cor){};35 this.self_cor.name = "Anonymous Thread";36 this.self_mon.owner = &this;37 this.self_mon.recursion = 1;38 this.self_mon_p = &this.self_mon;39 this.next = NULL;33 void ?{}(thread_desc& this) with( this ) { 34 self_cor{}; 35 self_cor.name = "Anonymous Coroutine"; 36 self_mon.owner = &this; 37 self_mon.recursion = 1; 38 self_mon_p = &self_mon; 39 next = NULL; 40 40 __cfaabi_dbg_debug_do( 41 this.dbg_next = NULL;42 this.dbg_prev = NULL;41 dbg_next = NULL; 42 dbg_prev = NULL; 43 43 __cfaabi_dbg_thread_register(&this); 44 44 ) 45 45 46 (this.monitors){ &this.self_mon_p, 1, (fptr_t)0 };46 monitors{ &self_mon_p, 1, (fptr_t)0 }; 47 47 } 48 48 49 void ^?{}(thread_desc& this) { 50 __cfaabi_dbg_debug_do( 51 __cfaabi_dbg_thread_unregister(&this); 52 ) 53 ^(this.self_cor){}; 49 void ^?{}(thread_desc& this) with( this ) { 50 ^self_cor{}; 54 51 } 55 52 56 53 forall( dtype T | sized(T) | is_thread(T) | { void ?{}(T&); } ) 57 void ?{}( scoped(T)& this ) {58 (this.handle){};59 __thrd_start( this.handle);54 void ?{}( scoped(T)& this ) with( this ) { 55 handle{}; 56 __thrd_start(handle); 60 57 } 61 58 62 59 forall( dtype T, ttype P | sized(T) | is_thread(T) | { void ?{}(T&, P); } ) 63 void ?{}( scoped(T)& this, P params ) {64 (this.handle){ params };65 __thrd_start( this.handle);60 void ?{}( scoped(T)& this, P params ) with( this ) { 61 handle{ params }; 62 __thrd_start(handle); 66 63 } 67 64 68 65 forall( dtype T | sized(T) | is_thread(T) ) 69 void ^?{}( scoped(T)& this ) {70 ^ (this.handle){};66 void ^?{}( scoped(T)& this ) with( this ) { 67 ^handle{}; 71 68 } 72 69 … … 76 73 void __thrd_start( T& this ) { 77 74 coroutine_desc* thrd_c = get_coroutine(this); 78 thread_desc *thrd_h = get_thread (this);75 thread_desc * thrd_h = get_thread (this); 79 76 thrd_c->last = this_coroutine; 80 77
Note: See TracChangeset
for help on using the changeset viewer.