Changeset afd7faf
- Timestamp:
- May 17, 2021, 9:20:55 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- d7ae173
- Parents:
- d2afe17
- Location:
- libcfa/src/concurrency
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/alarm.cfa
rd2afe17 rafd7faf 118 118 insert( &alarms, this ); 119 119 __kernel_set_timer( this->initial ); 120 this->set = true; 120 121 } 121 122 unlock( event_kernel->lock ); 122 this->set = true;123 123 enable_interrupts(); 124 124 } … … 129 129 { 130 130 verify( validate( event_kernel->alarms ) ); 131 remove( *this ); 131 if (this->set) remove( *this ); 132 this->set = false; 132 133 } 133 134 unlock( event_kernel->lock ); 134 135 enable_interrupts(); 135 this->set = false;136 136 } 137 137 -
libcfa/src/concurrency/locks.cfa
rd2afe17 rafd7faf 313 313 314 314 // helper for wait()'s' with a timeout 315 void queue_info_thread_timeout( condition_variable(L) & this, info_thread(L) & info, Duration t ) with(this) {315 void queue_info_thread_timeout( condition_variable(L) & this, info_thread(L) & info, Duration t, Alarm_Callback callback ) with(this) { 316 316 lock( lock __cfaabi_dbg_ctx2 ); 317 317 size_t recursion_count = queue_and_get_recursion(this, &info); 318 alarm_node_wrap(L) node_wrap = { t, 0`s, alarm_node_wrap_cast, &this, &info };318 alarm_node_wrap(L) node_wrap = { t, 0`s, callback, &this, &info }; 319 319 register_self( &node_wrap.alarm_node ); 320 320 unlock( lock ); … … 332 332 #define WAIT_TIME( u, l, t ) \ 333 333 info_thread( L ) i = { active_thread(), u, l }; \ 334 queue_info_thread_timeout(this, i, t ); \334 queue_info_thread_timeout(this, i, t, alarm_node_wrap_cast ); \ 335 335 return i.signalled; 336 336
Note: See TracChangeset
for help on using the changeset viewer.