Changeset c20533ea


Ignore:
Timestamp:
Dec 26, 2020, 6:10:40 PM (9 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast-unique-expr
Children:
ac5816d
Parents:
83c7e3c
Message:

Fixed locks.hfa to no longer depend on private headers bits/algorithm.hfa and alarm.hfa

Location:
libcfa/src/concurrency
Files:
2 edited

Legend:

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

    r83c7e3c rc20533ea  
    176176size_t get_recursion_count( multiple_acquisition_lock & this ){ return get_recursion_count( (blocking_lock &)this ); }
    177177
    178 ///////////////////////////////////////////////////////////////////
    179 //// condition variable
    180 ///////////////////////////////////////////////////////////////////
    181178
    182179forall(dtype L | is_blocking_lock(L)) {
     180        struct alarm_node_wrap {
     181                alarm_node_t alarm_node;
     182                condition_variable(L) * cond;
     183                info_thread(L) * i;
     184        };
     185
     186        void ?{}( alarm_node_wrap(L) & this, Time alarm, Duration period, Alarm_Callback callback ) {
     187                this.alarm_node{ callback, alarm, period };
     188        }
     189
     190        void ^?{}( alarm_node_wrap(L) & this ) { }
    183191
    184192        void timeout_handler ( alarm_node_wrap(L) & this ) with( this ) {
     
    205213        void alarm_node_wrap_cast( alarm_node_t & a ) { timeout_handler( (alarm_node_wrap(L) &)a ); }
    206214
     215}
     216
     217///////////////////////////////////////////////////////////////////
     218//// condition variable
     219///////////////////////////////////////////////////////////////////
     220
     221forall(dtype L | is_blocking_lock(L)) {
     222
    207223        void ?{}( condition_variable(L) & this ){
    208224                this.lock{};
     
    212228
    213229        void ^?{}( condition_variable(L) & this ){ }
    214 
    215         void ?{}( alarm_node_wrap(L) & this, Time alarm, Duration period, Alarm_Callback callback ) {
    216                 this.alarm_node{ callback, alarm, period };
    217         }
    218 
    219         void ^?{}( alarm_node_wrap(L) & this ) { }
    220230
    221231        void process_popped( condition_variable(L) & this, info_thread(L) & popped ) with( this ) {
  • libcfa/src/concurrency/locks.hfa

    r83c7e3c rc20533ea  
    33#include <stdbool.h>
    44
    5 #include "bits/algorithm.hfa"
    65#include "bits/locks.hfa"
    76#include "bits/sequence.hfa"
     
    1211#include "time.hfa"
    1312#include <sys/time.h>
    14 #include "alarm.hfa"
    1513
    1614///////////////////////////////////////////////////////////////////
     
    149147        void ^?{}( condition_variable(L) & this );
    150148
    151         struct alarm_node_wrap {
    152                 alarm_node_t alarm_node;
    153 
    154                 condition_variable(L) * cond;
    155 
    156                 info_thread(L) * i;
    157         };
    158 
    159         void ?{}( alarm_node_wrap(L) & this, Time alarm, Duration period, Alarm_Callback callback );
    160         void ^?{}( alarm_node_wrap(L) & this );
    161 
    162         void alarm_node_callback( alarm_node_wrap(L) & this );
    163 
    164         void alarm_node_wrap_cast( alarm_node_t & a );
    165 
    166149        bool notify_one( condition_variable(L) & this );
    167150        bool notify_all( condition_variable(L) & this );
Note: See TracChangeset for help on using the changeset viewer.