Changeset c20533ea for libcfa/src/concurrency/locks.cfa
- Timestamp:
- Dec 26, 2020, 6:10:40 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:
- ac5816d
- Parents:
- 83c7e3c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/locks.cfa
r83c7e3c rc20533ea 176 176 size_t get_recursion_count( multiple_acquisition_lock & this ){ return get_recursion_count( (blocking_lock &)this ); } 177 177 178 ///////////////////////////////////////////////////////////////////179 //// condition variable180 ///////////////////////////////////////////////////////////////////181 178 182 179 forall(dtype L | is_blocking_lock(L)) { 180 struct alarm_node_wrap { 181 alarm_node_t alarm_node; 182 condition_variable(L) * cond; 183 info_thread(L) * i; 184 }; 185 186 void ?{}( alarm_node_wrap(L) & this, Time alarm, Duration period, Alarm_Callback callback ) { 187 this.alarm_node{ callback, alarm, period }; 188 } 189 190 void ^?{}( alarm_node_wrap(L) & this ) { } 183 191 184 192 void timeout_handler ( alarm_node_wrap(L) & this ) with( this ) { … … 205 213 void alarm_node_wrap_cast( alarm_node_t & a ) { timeout_handler( (alarm_node_wrap(L) &)a ); } 206 214 215 } 216 217 /////////////////////////////////////////////////////////////////// 218 //// condition variable 219 /////////////////////////////////////////////////////////////////// 220 221 forall(dtype L | is_blocking_lock(L)) { 222 207 223 void ?{}( condition_variable(L) & this ){ 208 224 this.lock{}; … … 212 228 213 229 void ^?{}( condition_variable(L) & this ){ } 214 215 void ?{}( alarm_node_wrap(L) & this, Time alarm, Duration period, Alarm_Callback callback ) {216 this.alarm_node{ callback, alarm, period };217 }218 219 void ^?{}( alarm_node_wrap(L) & this ) { }220 230 221 231 void process_popped( condition_variable(L) & this, info_thread(L) & popped ) with( this ) {
Note: See TracChangeset
for help on using the changeset viewer.