Ignore:
File:
1 edited

Legend:

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

    rafd7faf r43784ac  
    1616
    1717#define __cforall_thread__
     18#define _GNU_SOURCE
    1819
    1920#include "locks.hfa"
     
    188189                alarm_node_t alarm_node;
    189190                condition_variable(L) * cond;
    190                 info_thread(L) * i;
     191                info_thread(L) * info_thd;
    191192        };
    192193
     
    194195                this.alarm_node{ callback, alarm, period };
    195196                this.cond = c;
    196                 this.i = i;
     197                this.info_thd = i;
    197198        }
    198199
     
    206207                //      may still be called after a thread has been removed from the queue but
    207208                //      before the alarm is unregistered
    208                 if ( listed(i) ) {      // is thread on queue
    209                         i->signalled = false;
     209                if ( listed(info_thd) ) {       // is thread on queue
     210                        info_thd->signalled = false;
    210211                        // remove this thread O(1)
    211                         remove( cond->blocked_threads, *i );
     212                        remove( cond->blocked_threads, *info_thd );
    212213                        cond->count--;
    213                         if( i->lock ) {
     214                        if( info_thd->lock ) {
    214215                                // 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);
    216217                        } else {
    217218                                // otherwise wake thread
    218                                 unpark( i->t );
     219                                unpark( info_thd->t );
    219220                        }
    220221                }
Note: See TracChangeset for help on using the changeset viewer.