Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/locks.cfa

    r43784ac rafd7faf  
    1616
    1717#define __cforall_thread__
    18 #define _GNU_SOURCE
    1918
    2019#include "locks.hfa"
     
    189188                alarm_node_t alarm_node;
    190189                condition_variable(L) * cond;
    191                 info_thread(L) * info_thd;
     190                info_thread(L) * i;
    192191        };
    193192
     
    195194                this.alarm_node{ callback, alarm, period };
    196195                this.cond = c;
    197                 this.info_thd = i;
     196                this.i = i;
    198197        }
    199198
     
    207206                //      may still be called after a thread has been removed from the queue but
    208207                //      before the alarm is unregistered
    209                 if ( listed(info_thd) ) {       // is thread on queue
    210                         info_thd->signalled = false;
     208                if ( listed(i) ) {      // is thread on queue
     209                        i->signalled = false;
    211210                        // remove this thread O(1)
    212                         remove( cond->blocked_threads, *info_thd );
     211                        remove( cond->blocked_threads, *i );
    213212                        cond->count--;
    214                         if( info_thd->lock ) {
     213                        if( i->lock ) {
    215214                                // call lock's on_notify if a lock was passed
    216                                 on_notify(*info_thd->lock, info_thd->t);
     215                                on_notify(*i->lock, i->t);
    217216                        } else {
    218217                                // otherwise wake thread
    219                                 unpark( info_thd->t );
     218                                unpark( i->t );
    220219                        }
    221220                }
Note: See TracChangeset for help on using the changeset viewer.