- File:
-
- 1 edited
-
libcfa/src/concurrency/thread.cfa (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/thread.cfa
rfcd0b9d7 rfd54fef 62 62 } 63 63 64 FORALL_DATA_INSTANCE(ThreadCancelled, ( dtype thread_t), (thread_t))64 FORALL_DATA_INSTANCE(ThreadCancelled, (thread_t &), (thread_t)) 65 65 66 forall( dtype T)66 forall(T &) 67 67 void copy(ThreadCancelled(T) * dst, ThreadCancelled(T) * src) { 68 68 dst->virtual_table = src->virtual_table; … … 71 71 } 72 72 73 forall( dtype T)73 forall(T &) 74 74 const char * msg(ThreadCancelled(T) *) { 75 75 return "ThreadCancelled"; 76 76 } 77 77 78 forall( dtype T)78 forall(T &) 79 79 static void default_thread_cancel_handler(ThreadCancelled(T) & ) { 80 80 abort( "Unhandled thread cancellation.\n" ); 81 81 } 82 82 83 forall( dtype T| is_thread(T) | IS_EXCEPTION(ThreadCancelled, (T)))83 forall(T & | is_thread(T) | IS_EXCEPTION(ThreadCancelled, (T))) 84 84 void ?{}( thread_dtor_guard_t & this, 85 85 T & thrd, void(*cancelHandler)(ThreadCancelled(T) &)) { … … 124 124 //----------------------------------------------------------------------------- 125 125 // Starting and stopping threads 126 forall( dtype T| is_thread(T) )126 forall( T & | is_thread(T) ) 127 127 void __thrd_start( T & this, void (*main_p)(T &) ) { 128 128 $thread * this_thrd = get_thread(this); … … 140 140 //----------------------------------------------------------------------------- 141 141 // Support for threads that don't ues the thread keyword 142 forall( dtype T| sized(T) | is_thread(T) | { void ?{}(T&); } )142 forall( T & | sized(T) | is_thread(T) | { void ?{}(T&); } ) 143 143 void ?{}( scoped(T)& this ) with( this ) { 144 144 handle{}; … … 146 146 } 147 147 148 forall( dtype T, ttype P| sized(T) | is_thread(T) | { void ?{}(T&, P); } )148 forall( T &, P... | sized(T) | is_thread(T) | { void ?{}(T&, P); } ) 149 149 void ?{}( scoped(T)& this, P params ) with( this ) { 150 150 handle{ params }; … … 152 152 } 153 153 154 forall( dtype T| sized(T) | is_thread(T) )154 forall( T & | sized(T) | is_thread(T) ) 155 155 void ^?{}( scoped(T)& this ) with( this ) { 156 156 ^handle{}; … … 158 158 159 159 //----------------------------------------------------------------------------- 160 forall( dtype T| is_thread(T) | IS_RESUMPTION_EXCEPTION(ThreadCancelled, (T)))160 forall(T & | is_thread(T) | IS_RESUMPTION_EXCEPTION(ThreadCancelled, (T))) 161 161 T & join( T & this ) { 162 162 thread_dtor_guard_t guard = { this, defaultResumptionHandler };
Note:
See TracChangeset
for help on using the changeset viewer.