- File:
-
- 1 edited
-
libcfa/src/concurrency/locks.cfa (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/locks.cfa
r43784ac rafd7faf 16 16 17 17 #define __cforall_thread__ 18 #define _GNU_SOURCE19 18 20 19 #include "locks.hfa" … … 189 188 alarm_node_t alarm_node; 190 189 condition_variable(L) * cond; 191 info_thread(L) * i nfo_thd;190 info_thread(L) * i; 192 191 }; 193 192 … … 195 194 this.alarm_node{ callback, alarm, period }; 196 195 this.cond = c; 197 this.i nfo_thd= i;196 this.i = i; 198 197 } 199 198 … … 207 206 // may still be called after a thread has been removed from the queue but 208 207 // before the alarm is unregistered 209 if ( listed(i nfo_thd) ) { // is thread on queue210 i nfo_thd->signalled = false;208 if ( listed(i) ) { // is thread on queue 209 i->signalled = false; 211 210 // remove this thread O(1) 212 remove( cond->blocked_threads, *i nfo_thd);211 remove( cond->blocked_threads, *i ); 213 212 cond->count--; 214 if( i nfo_thd->lock ) {213 if( i->lock ) { 215 214 // call lock's on_notify if a lock was passed 216 on_notify(*i nfo_thd->lock, info_thd->t);215 on_notify(*i->lock, i->t); 217 216 } else { 218 217 // otherwise wake thread 219 unpark( i nfo_thd->t );218 unpark( i->t ); 220 219 } 221 220 }
Note:
See TracChangeset
for help on using the changeset viewer.