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