Ignore:
Timestamp:
May 4, 2020, 8:59:09 PM (4 years ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
08a994e, f90d10f
Parents:
4d741e9
Message:

Using dlist in alarm.

Minimal interface changes in alarm.hfa applied; some spill to preemption.cfa occured.

List management logic removed, including such helper functions from alarm.cfa. Remaining logic is concurrency-protection wrapping, and picking insertion point by traversing and comparing alarm-fire times.

Integrity checking definitions removed here. Calling version brought into list.hfa by change 4d741 instead.

File:
1 edited

Legend:

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

    r4d741e9 rd3ab183  
    2323#include "time.hfa"
    2424
     25#include <containers/list.hfa>
     26
    2527struct $thread;
    2628struct processor;
     
    4042        Time alarm;                             // time when alarm goes off
    4143        Duration period;                        // if > 0 => period of alarm
    42         alarm_node_t * next;            // intrusive link list field
     44
     45        DLISTED_MGD_IMPL_IN(alarm_node_t)
    4346
    4447        union {
     
    5053        bool kernel_alarm       :1;             // true if this is not a user defined alarm
    5154};
    52 
    53 typedef alarm_node_t ** __alarm_it_t;
     55DLISTED_MGD_IMPL_OUT(alarm_node_t)
    5456
    5557void ?{}( alarm_node_t & this, $thread * thrd, Time alarm, Duration period );
     
    5759void ^?{}( alarm_node_t & this );
    5860
    59 struct alarm_list_t {
    60         alarm_node_t * head;
    61         __alarm_it_t tail;
    62 };
    63 
    64 static inline void ?{}( alarm_list_t & this ) with( this ) {
    65         head = 0;
    66         tail = &head;
    67 }
     61typedef dlist(alarm_node_t, alarm_node_t) alarm_list_t;
    6862
    6963void insert( alarm_list_t * this, alarm_node_t * n );
Note: See TracChangeset for help on using the changeset viewer.