Changeset 3959595 for libcfa


Ignore:
Timestamp:
Nov 5, 2020, 9:52:11 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
231b18f, b5d51b0
Parents:
be73f30 (diff), 3febb2d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Location:
libcfa/src/concurrency
Files:
5 edited

Legend:

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

    rbe73f30 r3959595  
    4545//=============================================================================================
    4646
    47 void ?{}( alarm_node_t & this, $thread * thrd, Time alarm, Duration period ) with( this ) {
     47void ?{}( alarm_node_t & this, $thread * thrd, Time alarm, Duration period) with( this ) {
    4848        this.thrd = thrd;
    4949        this.alarm = alarm;
    5050        this.period = period;
    5151        set = false;
    52         kernel_alarm = false;
     52        type = User;
    5353}
    5454
     
    5858        this.period = period;
    5959        set = false;
    60         kernel_alarm = true;
     60        type = Kernel;
     61}
     62void ?{}( alarm_node_t & this, $thread * thrd, Time alarm, Duration period, Alarm_Callback callback ) with( this ) {
     63        this.thrd = thrd;
     64        this.alarm = alarm;
     65        this.period = period;
     66        this.callback = callback;
     67        set = false;
     68        type = Callback;
    6169}
    6270
  • libcfa/src/concurrency/alarm.hfa

    rbe73f30 r3959595  
    3939//=============================================================================================
    4040
     41enum alarm_type{ Kernel = 0, User = 1, Callback = 2 };
     42
     43struct alarm_node_t;
     44
     45typedef void (*Alarm_Callback)(alarm_node_t & );
     46
    4147struct alarm_node_t {
    4248        Time alarm;                             // time when alarm goes off
     
    5056        };
    5157
     58        Alarm_Callback callback;
     59
    5260        bool set                :1;             // whether or not the alarm has be registered
    53         bool kernel_alarm       :1;             // true if this is not a user defined alarm
     61        enum alarm_type type;           // true if this is not a user defined alarm
    5462};
    5563DLISTED_MGD_IMPL_OUT(alarm_node_t)
     
    5765void ?{}( alarm_node_t & this, $thread * thrd, Time alarm, Duration period );
    5866void ?{}( alarm_node_t & this, processor   * proc, Time alarm, Duration period );
     67void ?{}( alarm_node_t & this, $thread * thrd, Time alarm, Duration period, Alarm_Callback callback );
    5968void ^?{}( alarm_node_t & this );
    6069
  • libcfa/src/concurrency/locks.cfa

    rbe73f30 r3959595  
    1515                this.t = t;
    1616                this.lock = 0p;
     17                this.listed = false;
    1718        }
    1819
     
    2122                this.info = info;
    2223                this.lock = 0p;
     24                this.listed = false;
    2325        }
    2426
     
    7880        if ( owner == thrd && !multi_acquisition) {
    7981                fprintf(stderr, "A single acquisition lock holder attempted to reacquire the lock resulting in a deadlock."); // Possibly throw instead
    80                 exit(EXIT_FAILURE);
     82        exit(EXIT_FAILURE);
    8183        } else if ( owner != 0p && owner != thrd ) {
    8284                append( blocked_threads, thrd );
    8385                wait_count++;
    8486                unlock( lock );
    85                 park( __cfaabi_dbg_ctx );
     87                park( );
    8688        } else if ( owner == thrd && multi_acquisition ) {
    8789                recursion_count++;
     
    115117                fprintf( stderr, "There was an attempt to release a lock that isn't held" );
    116118                return;
    117         } else if ( strict_owner && owner != active_thread() ) {
     119        } else if ( strict_owner && active_thread() ) {
    118120                fprintf( stderr, "A thread other than the owner attempted to release an owner lock" );
    119121                return;
     
    125127                recursion_count = ( thrd && multi_acquisition ? 1 : 0 );
    126128                wait_count--;
    127                 unpark( thrd __cfaabi_dbg_ctx2 );
     129                unpark( thrd );
    128130        }
    129131        unlock( lock );
     
    152154                owner = t;
    153155                if ( multi_acquisition ) recursion_count = 1;
    154                 unpark( t __cfaabi_dbg_ctx2 );
     156                #if !defined( __CFA_NO_STATISTICS__ )
     157                        kernelTLS.this_stats = t->curr_cluster->stats;
     158                #endif
     159                unpark( t );
    155160                unlock( lock );
    156161        }
     
    161166        if ( owner == 0p ){ // no owner implies lock isn't held
    162167                fprintf( stderr, "A lock that is not held was passed to a synchronization lock" );
    163         } else if ( strict_owner && owner != active_thread() ) {
     168        } else if ( strict_owner && active_thread() ) {
    164169                fprintf( stderr, "A thread other than the owner of a lock passed it to a synchronization lock" );
    165170        } else {
     
    168173                recursion_count = ( thrd && multi_acquisition ? 1 : 0 );
    169174                wait_count--;
    170                 unpark( thrd __cfaabi_dbg_ctx2 );
     175                unpark( thrd );
    171176        }
    172177        unlock( lock );
     
    177182///////////////////////////////////////////////////////////////////
    178183
    179 // In an ideal world this may not be necessary
    180 // Is it possible for nominal inheritance to inherit traits??
    181 // If that occurs we would avoid all this extra code
     184// This is temporary until an inheritance bug is fixed
    182185
    183186void lock( mutex_lock & this ){
     
    230233
    231234///////////////////////////////////////////////////////////////////
    232 //// Synchronization Locks
     235//// condition variable
    233236///////////////////////////////////////////////////////////////////
    234237
    235238forall(dtype L | is_blocking_lock(L)) {
    236         void ?{}( synchronization_lock(L) & this, bool reacquire_after_signal ){
     239
     240        void timeout_handler ( alarm_node_wrap(L) & this ) with( this ) {
     241        // This condition_variable member is called from the kernel, and therefore, cannot block, but it can spin.
     242            lock( cond->lock __cfaabi_dbg_ctx2 );
     243            if ( (*i)->listed ) {                       // is thread on queue
     244                info_thread(L) * copy = *i;
     245                        remove( cond->blocked_threads, i );              //remove this thread O(1)
     246                        cond->wait_count--;
     247                        if( !copy->lock ) {
     248                                unlock( cond->lock );
     249                                #if !defined( __CFA_NO_STATISTICS__ )
     250                                        #warning unprotected access to tls TODO discuss this
     251                                        kernelTLS.this_stats = copy->t->curr_cluster->stats;
     252                                #endif
     253                                unpark( copy->t );
     254                } else {
     255                        add_(*copy->lock, copy->t);                     // call lock's add_
     256                }
     257            }
     258            unlock( cond->lock );
     259        }
     260
     261        void alarm_node_wrap_cast( alarm_node_t & a ) {
     262                timeout_handler( (alarm_node_wrap(L) &)a );
     263        }
     264
     265        void ?{}( condition_variable(L) & this ){
    237266                this.lock{};
    238267                this.blocked_threads{};
    239268                this.count = 0;
    240                 this.reacquire_after_signal = reacquire_after_signal;
    241         }
    242 
    243         void ^?{}( synchronization_lock(L) & this ){
    244                 // default
    245         }
    246 
    247         void ?{}( condition_variable(L) & this ){
    248                 ((synchronization_lock(L) &)this){ true };
    249269        }
    250270
     
    253273        }
    254274
    255         void ?{}( thread_queue(L) & this ){
    256                 ((synchronization_lock(L) &)this){ false };
    257         }
    258 
    259         void ^?{}( thread_queue(L) & this ){
     275        void ?{}( alarm_node_wrap(L) & this, $thread * thrd, Time alarm, Duration period, Alarm_Callback callback ) {
     276                this.alarm_node{ thrd, alarm, period, callback };
     277        }
     278
     279        void ^?{}( alarm_node_wrap(L) & this ) {
    260280                // default
    261281        }
    262282
    263         bool notify_one( synchronization_lock(L) & this ) with( this ) {
     283        bool notify_one( condition_variable(L) & this ) with( this ) {
    264284                lock( lock __cfaabi_dbg_ctx2 );
    265285                bool ret = !!blocked_threads;
    266286                info_thread(L) * popped = pop_head( blocked_threads );
     287                popped->listed = false;
    267288                if(popped != 0p) {
    268                         if( reacquire_after_signal ){
     289                        count--;
     290                        if (popped->lock) {
    269291                                add_(*popped->lock, popped->t);
    270292                        } else {
    271                                 unpark(
    272                                         popped->t __cfaabi_dbg_ctx2
    273                                 );
     293                                unpark(popped->t);
    274294                        }
    275295                }
     
    278298        }
    279299
    280         bool notify_all( synchronization_lock(L) & this ) with(this) {
     300        bool notify_all( condition_variable(L) & this ) with(this) {
    281301                lock( lock __cfaabi_dbg_ctx2 );
    282302                bool ret = blocked_threads ? true : false;
    283303                while( blocked_threads ) {
    284304                        info_thread(L) * popped = pop_head( blocked_threads );
     305                        popped->listed = false;
    285306                        if(popped != 0p){
    286                                 if( reacquire_after_signal ){
     307                                count--;
     308                                if (popped->lock) {
    287309                                        add_(*popped->lock, popped->t);
    288310                                } else {
    289                                         unpark(
    290                                                 popped->t __cfaabi_dbg_ctx2
    291                                         );
     311                                        unpark(popped->t);
    292312                                }
    293313                        }
     
    297317        }
    298318
    299         uintptr_t front( synchronization_lock(L) & this ) with(this) {
    300                 return (*peek(blocked_threads)).info;
    301         }
    302 
    303         bool empty( synchronization_lock(L) & this ) with(this) {
     319        uintptr_t front( condition_variable(L) & this ) with(this) {
     320                if(!blocked_threads) return NULL;
     321                return peek(blocked_threads)->info;
     322        }
     323
     324        bool empty( condition_variable(L) & this ) with(this) {
    304325                return blocked_threads ? false : true;
    305326        }
    306327
    307         int counter( synchronization_lock(L) & this ) with(this) {
     328        int counter( condition_variable(L) & this ) with(this) {
    308329                return count;
    309330        }
    310331
    311         void queue_info_thread( synchronization_lock(L) & this, info_thread(L) & i ) with(this) {
    312                 lock( lock __cfaabi_dbg_ctx2 );
    313                 append( blocked_threads, &i );
    314                 count++;
    315                 unlock( lock );
    316                 park( __cfaabi_dbg_ctx );
    317         }
    318 
    319 
    320         void wait( synchronization_lock(L) & this ) with(this) {
    321                 info_thread( L ) i = { active_thread() };
    322                 queue_info_thread( this, i );
    323         }
    324 
    325         void wait( synchronization_lock(L) & this, uintptr_t info ) with(this) {
    326                 info_thread( L ) i = { active_thread(), info };
    327                 queue_info_thread( this, i );
    328         }
    329         // I still need to implement the time delay wait routines
    330         bool wait( synchronization_lock(L) & this, Duration duration ) with(this) {
    331                 timeval tv = { time(0) };
    332                 Time t = { tv };
    333                 return wait( this, t + duration );
    334         }
    335 
    336         bool wait( synchronization_lock(L) & this, uintptr_t info, Duration duration ) with(this) {
    337                 // TODO: ADD INFO
    338                 return wait( this, duration );
    339         }
    340 
    341         bool wait( synchronization_lock(L) & this, Time time ) with(this) {
    342                 return false; //default
    343         }
    344 
    345         bool wait( synchronization_lock(L) & this, uintptr_t info, Time time ) with(this) {
    346                 // TODO: ADD INFO
    347                 return wait( this, time );
    348         }
    349 
    350         void queue_info_thread_unlock( synchronization_lock(L) & this, L & l, info_thread(L) & i ) with(this) {
     332        // helper for wait()'s' without a timeout
     333        void queue_info_thread( condition_variable(L) & this, info_thread(L) & i ) with(this) {
    351334                lock( lock __cfaabi_dbg_ctx2 );
    352335                append( this.blocked_threads, &i );
    353336                count++;
    354                 i.lock = &l;
    355                 size_t recursion_count = get_recursion_count(l);
    356                 remove_( l );
    357                 unlock( lock );
    358                 park( __cfaabi_dbg_ctx ); // blocks here
    359 
    360                 set_recursion_count(l, recursion_count); // resets recursion count here after waking
    361         }
    362 
    363         void wait( synchronization_lock(L) & this, L & l ) with(this) {
     337                i.listed = true;
     338                size_t recursion_count;
     339                if (i.lock) {
     340                        recursion_count = get_recursion_count(*i.lock);
     341                        remove_( *i.lock );
     342                }
     343
     344                unlock( lock );
     345                park( ); // blocks here
     346
     347                if (i.lock) set_recursion_count(*i.lock, recursion_count); // resets recursion count here after waking
     348        }
     349
     350        // helper for wait()'s' with a timeout
     351        void queue_info_thread_timeout( condition_variable(L) & this, info_thread(L) & info, Time t ) with(this) {
     352                lock( lock __cfaabi_dbg_ctx2 );
     353
     354                info_thread(L) * queue_ptr = &info;
     355
     356                alarm_node_wrap(L) node_wrap = { info.t, t, 0`s, alarm_node_wrap_cast };
     357                node_wrap.cond = &this;
     358                node_wrap.i = &queue_ptr;
     359
     360                register_self( &node_wrap.alarm_node );
     361
     362                append( blocked_threads, queue_ptr );
     363                info.listed = true;
     364                count++;
     365
     366                size_t recursion_count;
     367                if (info.lock) {
     368                        recursion_count = get_recursion_count(*info.lock);
     369                        remove_( *info.lock );
     370                }
     371
     372                unlock( lock );
     373                park();
     374
     375                if (info.lock) set_recursion_count(*info.lock, recursion_count);
     376        }
     377
     378        void wait( condition_variable(L) & this ) with(this) {
     379                info_thread( L ) i = { active_thread() };
     380                queue_info_thread( this, i );
     381        }
     382
     383        void wait( condition_variable(L) & this, uintptr_t info ) with(this) {
     384                info_thread( L ) i = { active_thread(), info };
     385                queue_info_thread( this, i );
     386        }
     387
     388        void wait( condition_variable(L) & this, Duration duration ) with(this) {
     389                info_thread( L ) i = { active_thread() };
     390                queue_info_thread_timeout(this, i, __kernel_get_time() + duration );
     391        }
     392
     393        void wait( condition_variable(L) & this, uintptr_t info, Duration duration ) with(this) {
     394                info_thread( L ) i = { active_thread(), info };
     395                queue_info_thread_timeout(this, i, __kernel_get_time() + duration );
     396        }
     397
     398        void wait( condition_variable(L) & this, Time time ) with(this) {
     399                info_thread( L ) i = { active_thread() };
     400                queue_info_thread_timeout(this, i, time);
     401        }
     402
     403        void wait( condition_variable(L) & this, uintptr_t info, Time time ) with(this) {
     404                info_thread( L ) i = { active_thread(), info };
     405                queue_info_thread_timeout(this, i, time);
     406        }
     407
     408        void wait( condition_variable(L) & this, L & l ) with(this) {
    364409                info_thread(L) i = { active_thread() };
    365                 queue_info_thread_unlock( this, l, i );
    366         }
    367 
    368         void wait( synchronization_lock(L) & this, L & l, uintptr_t info ) with(this) {
     410                i.lock = &l;
     411                queue_info_thread( this, i );
     412        }
     413
     414        void wait( condition_variable(L) & this, L & l, uintptr_t info ) with(this) {
    369415                info_thread(L) i = { active_thread(), info };
    370                 queue_info_thread_unlock( this, l, i );
    371         }
    372 
    373         bool wait( synchronization_lock(L) & this, L & l, Duration duration ) with(this) {
    374                 timeval tv = { time(0) };
    375                 Time t = { tv };
    376                 return wait( this, l, t + duration );
    377         }
    378 
    379         bool wait( synchronization_lock(L) & this, L & l, uintptr_t info, Duration duration ) with(this) {
    380                 // TODO: ADD INFO
    381                 return wait( this, l, duration );
    382         }
    383 
    384         bool wait( synchronization_lock(L) & this, L & l, Time time ) with(this) {
    385                 return false; //default
    386         }
    387 
    388         bool wait( synchronization_lock(L) & this, L & l, uintptr_t info, Time time ) with(this) {
    389                 // TODO: ADD INFO
    390                 return wait( this, l, time );
    391         }
    392 }
    393 
    394 ///////////////////////////////////////////////////////////////////
    395 //// condition lock alternative approach
    396 ///////////////////////////////////////////////////////////////////
    397 
    398 // the solution below is less efficient but does not require the lock to have a specific add/remove routine
    399 
    400 ///////////////////////////////////////////////////////////////////
    401 //// is_simple_lock
    402 ///////////////////////////////////////////////////////////////////
    403 
    404 forall(dtype L | is_simple_lock(L)) {
    405         void ?{}( condition_lock(L) & this ){
    406                 // default
    407         }
    408 
    409         void ^?{}( condition_lock(L) & this ){
    410                 // default
    411         }
    412 
    413         bool notify_one( condition_lock(L) & this ) with(this) {
    414                 return notify_one( c_var );
    415         }
    416 
    417         bool notify_all( condition_lock(L) & this ) with(this) {
    418                 return notify_all( c_var );
    419         }
    420 
    421         void wait( condition_lock(L) & this, L & l ) with(this) {
    422                 lock( m_lock );
    423                 size_t recursion = get_recursion_count( l );
    424                 unlock( l );
    425                 wait( c_var, m_lock );
    426                 lock( l );
    427                 set_recursion_count( l , recursion );
    428                 unlock( m_lock );
    429         }
    430 }
     416                i.lock = &l;
     417                queue_info_thread( this, i );
     418        }
     419
     420        void wait( condition_variable(L) & this, L & l, Duration duration ) with(this) {
     421                info_thread(L) i = { active_thread() };
     422                i.lock = &l;
     423                queue_info_thread_timeout(this, i, __kernel_get_time() + duration );
     424        }
     425
     426        void wait( condition_variable(L) & this, L & l, uintptr_t info, Duration duration ) with(this) {
     427                info_thread(L) i = { active_thread(), info };
     428                i.lock = &l;
     429                queue_info_thread_timeout(this, i, __kernel_get_time() + duration );
     430        }
     431
     432        void wait( condition_variable(L) & this, L & l, Time time ) with(this) {
     433                info_thread(L) i = { active_thread() };
     434                i.lock = &l;
     435                queue_info_thread_timeout(this, i, time );
     436        }
     437
     438        void wait( condition_variable(L) & this, L & l, uintptr_t info, Time time ) with(this) {
     439                info_thread(L) i = { active_thread(), info };
     440                i.lock = &l;
     441                queue_info_thread_timeout(this, i, time );
     442        }
     443}
  • libcfa/src/concurrency/locks.hfa

    rbe73f30 r3959595  
     1#pragma once
     2
    13#include <stdbool.h>
    24
     
    1012#include "time.hfa"
    1113#include <sys/time.h>
     14#include "alarm.hfa"
    1215
    1316///////////////////////////////////////////////////////////////////
     
    3235                info_thread(L) * next;
    3336                L * lock;
     37                bool listed;                                    // true if info_thread is on queue, false otherwise;
    3438        };
    3539
     
    119123///////////////////////////////////////////////////////////////////
    120124forall(dtype L | is_blocking_lock(L)) {
    121         struct synchronization_lock {
     125        struct condition_variable {
    122126                // Spin lock used for mutual exclusion
    123127                __spinlock_t lock;
     
    128132                // Count of current blocked threads
    129133                int count;
    130 
    131                 // If true threads will reacquire the lock they block on upon waking
    132                 bool reacquire_after_signal;
    133134        };
    134 
    135         struct condition_variable {
    136                 inline synchronization_lock(L);
    137         };
    138 
    139         struct thread_queue {
    140                 inline synchronization_lock(L);
    141         };
    142 
    143 
    144         void ?{}( synchronization_lock(L) & this, bool multi_acquisition, bool strict_owner );
    145         void ^?{}( synchronization_lock(L) & this );
    146135
    147136        void ?{}( condition_variable(L) & this );
    148137        void ^?{}( condition_variable(L) & this );
    149138
    150         void ?{}( thread_queue(L) & this );
    151         void ^?{}( thread_queue(L) & this );
     139        struct alarm_node_wrap {
     140                alarm_node_t alarm_node;
    152141
    153         bool notify_one( synchronization_lock(L) & this );
    154         bool notify_all( synchronization_lock(L) & this );
     142                condition_variable(L) * cond;
    155143
    156         uintptr_t front( synchronization_lock(L) & this );
    157 
    158         bool empty( synchronization_lock(L) & this );
    159         int counter( synchronization_lock(L) & this );
    160 
    161         // wait functions that are not passed a mutex lock
    162         void wait( synchronization_lock(L) & this );
    163         void wait( synchronization_lock(L) & this, uintptr_t info );
    164         bool wait( synchronization_lock(L) & this, Duration duration );
    165         bool wait( synchronization_lock(L) & this, uintptr_t info, Duration duration );
    166         bool wait( synchronization_lock(L) & this, Time time );
    167         bool wait( synchronization_lock(L) & this, uintptr_t info, Time time );
    168 
    169         // wait functions that are passed a lock
    170         bool notify_one( synchronization_lock(L) & this, L & l );
    171         bool notify_all( synchronization_lock(L) & this, L & l );
    172 
    173         void wait( synchronization_lock(L) & this, L & l );
    174         void wait( synchronization_lock(L) & this, L & l, uintptr_t info );
    175         bool wait( synchronization_lock(L) & this, L & l, Duration duration );
    176         bool wait( synchronization_lock(L) & this, L & l, uintptr_t info, Duration duration );
    177         bool wait( synchronization_lock(L) & this, L & l, Time time );
    178         bool wait( synchronization_lock(L) & this, L & l, uintptr_t info, Time time );
    179 }
    180 
    181 ///////////////////////////////////////////////////////////////////
    182 //// condition lock alternative approach
    183 ///////////////////////////////////////////////////////////////////
    184 
    185 
    186 ///////////////////////////////////////////////////////////////////
    187 //// is_simple_lock
    188 ///////////////////////////////////////////////////////////////////
    189 
    190 trait is_simple_lock(dtype L | sized(L)) {
    191         void lock( L & );               // For synchronization locks to use when acquiring
    192         void unlock( L & );    // For synchronization locks to use when releasing
    193         size_t get_recursion_count( L & ); // to get recursion count for cond lock to reset after waking
    194         void set_recursion_count( L &, size_t recursion ); // to set recursion count after getting signalled;
    195 };
    196 
    197 forall(dtype L | is_simple_lock(L)) {
    198         struct condition_lock {
    199                 // Spin lock used for mutual exclusion
    200                 mutex_lock m_lock;
    201 
    202                 condition_variable( mutex_lock ) c_var;
     144                info_thread(L) ** i;
    203145        };
    204146
    205         void ?{}( condition_lock(L) & this );
    206         void ^?{}( condition_lock(L) & this );
     147        void ?{}( alarm_node_wrap(L) & this, $thread * thrd, Time alarm, Duration period, Alarm_Callback callback );
     148        void ^?{}( alarm_node_wrap(L) & this );
    207149
    208         bool notify_one( condition_lock(L) & this );
    209         bool notify_all( condition_lock(L) & this );
    210         void wait( condition_lock(L) & this, L & l );
     150        void alarm_node_callback( alarm_node_wrap(L) & this );
     151
     152        void alarm_node_wrap_cast( alarm_node_t & a );
     153
     154        bool notify_one( condition_variable(L) & this );
     155        bool notify_all( condition_variable(L) & this );
     156
     157        uintptr_t front( condition_variable(L) & this );
     158
     159        bool empty( condition_variable(L) & this );
     160        int counter( condition_variable(L) & this );
     161
     162        // TODO: look into changing timout routines to return bool showing if signalled or woken by kernel
     163        void wait( condition_variable(L) & this );
     164        void wait( condition_variable(L) & this, uintptr_t info );
     165        void wait( condition_variable(L) & this, Duration duration );
     166        void wait( condition_variable(L) & this, uintptr_t info, Duration duration );
     167        void wait( condition_variable(L) & this, Time time );
     168        void wait( condition_variable(L) & this, uintptr_t info, Time time );
     169
     170        void wait( condition_variable(L) & this, L & l );
     171        void wait( condition_variable(L) & this, L & l, uintptr_t info );
     172        void wait( condition_variable(L) & this, L & l, Duration duration );
     173        void wait( condition_variable(L) & this, L & l, uintptr_t info, Duration duration );
     174        void wait( condition_variable(L) & this, L & l, Time time );
     175        void wait( condition_variable(L) & this, L & l, uintptr_t info, Time time );
    211176}
  • libcfa/src/concurrency/preemption.cfa

    rbe73f30 r3959595  
    105105
    106106                // Check if this is a kernel
    107                 if( node->kernel_alarm ) {
     107                if( node->type == Kernel ) {
    108108                        preempt( node->proc );
    109109                }
     110                else if( node->type == User ) {
     111                        timeout( node->thrd );
     112                }
    110113                else {
    111                         timeout( node->thrd );
     114                        node->callback(*node);
    112115                }
    113116
Note: See TracChangeset for help on using the changeset viewer.