Changeset 4aeaee5


Ignore:
Timestamp:
Dec 3, 2020, 4:47:41 PM (10 months ago)
Author:
Colby Alexander Parsons <caparsons@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast-unique-expr
Children:
8e655f7
Parents:
cad1df1
Message:

added alarm callback to union and refactored

Location:
libcfa/src/concurrency
Files:
4 edited

Legend:

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

    rcad1df1 r4aeaee5  
    6060        type = Kernel;
    6161}
    62 void ?{}( alarm_node_t & this, $thread * thrd, Time alarm, Duration period, Alarm_Callback callback ) with( this ) {
    63         this.thrd = thrd;
     62void ?{}( alarm_node_t & this, Alarm_Callback callback, Time alarm, Duration period ) with( this ) {
    6463        this.alarm = alarm;
    6564        this.period = period;
  • libcfa/src/concurrency/alarm.hfa

    rcad1df1 r4aeaee5  
    5252
    5353        union {
    54                 $thread * thrd; // thrd who created event
    55                 processor * proc;               // proc who created event
     54                $thread * thrd;                                 // thrd who created event
     55                processor * proc;                               // proc who created event
     56                Alarm_Callback callback;                // callback to handle event
    5657        };
    57 
    58         Alarm_Callback callback;
    5958
    6059        bool set                :1;             // whether or not the alarm has be registered
     
    6564void ?{}( alarm_node_t & this, $thread * thrd, Time alarm, Duration period );
    6665void ?{}( alarm_node_t & this, processor   * proc, Time alarm, Duration period );
    67 void ?{}( alarm_node_t & this, $thread * thrd, Time alarm, Duration period, Alarm_Callback callback );
     66void ?{}( alarm_node_t & this, Alarm_Callback callback, Time alarm, Duration period );
    6867void ^?{}( alarm_node_t & this );
    6968
  • libcfa/src/concurrency/locks.cfa

    rcad1df1 r4aeaee5  
    207207        void ^?{}( condition_variable(L) & this ){ }
    208208
    209         void ?{}( alarm_node_wrap(L) & this, $thread * thrd, Time alarm, Duration period, Alarm_Callback callback ) {
    210                 this.alarm_node{ thrd, alarm, period, callback };
     209        void ?{}( alarm_node_wrap(L) & this, Time alarm, Duration period, Alarm_Callback callback ) {
     210                this.alarm_node{ callback, alarm, period };
    211211        }
    212212
     
    277277                lock( lock __cfaabi_dbg_ctx2 );
    278278                size_t recursion_count = queue_and_get_recursion(this, &info);
    279                 alarm_node_wrap(L) node_wrap = { info.t, t, 0`s, alarm_node_wrap_cast };
     279                alarm_node_wrap(L) node_wrap = { t, 0`s, alarm_node_wrap_cast };
    280280                node_wrap.cond = &this;
    281281                node_wrap.i = &info;
  • libcfa/src/concurrency/locks.hfa

    rcad1df1 r4aeaee5  
    164164        };
    165165
    166         void ?{}( alarm_node_wrap(L) & this, $thread * thrd, Time alarm, Duration period, Alarm_Callback callback );
     166        void ?{}( alarm_node_wrap(L) & this, Time alarm, Duration period, Alarm_Callback callback );
    167167        void ^?{}( alarm_node_wrap(L) & this );
    168168
Note: See TracChangeset for help on using the changeset viewer.