Ignore:
Timestamp:
Feb 12, 2018, 11:57:50 AM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
d56ca354
Parents:
eb7f20c
Message:

Finished adding with statements to kernel

Location:
src/libcfa/concurrency
Files:
6 edited

Legend:

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

    reb7f20c rc40e7c5  
    4141void ?{}( __cfa_time_t & this, zero_t zero ) { this.val = 0; }
    4242
    43 void ?{}( itimerval & this, __cfa_time_t * alarm ) {
    44         this.it_value.tv_sec = alarm->val / one_second;                 // seconds
    45         this.it_value.tv_usec = max( (alarm->val % one_second) / one_microsecond, 1000 ); // microseconds
    46         this.it_interval.tv_sec = 0;
    47         this.it_interval.tv_usec = 0;
     43void ?{}( itimerval & this, __cfa_time_t * alarm ) with( this ) {
     44        it_value.tv_sec = alarm->val / one_second;                      // seconds
     45        it_value.tv_usec = max( (alarm->val % one_second) / one_microsecond, 1000 ); // microseconds
     46        it_interval.tv_sec = 0;
     47        it_interval.tv_usec = 0;
    4848}
    4949
     
    8484//=============================================================================================
    8585
    86 void ?{}( alarm_node_t & this, thread_desc * thrd, __cfa_time_t alarm = zero_time, __cfa_time_t period = zero_time ) {
     86void ?{}( alarm_node_t & this, thread_desc * thrd, __cfa_time_t alarm = zero_time, __cfa_time_t period = zero_time ) with( this ) {
    8787        this.thrd = thrd;
    8888        this.alarm = alarm;
    8989        this.period = period;
    90         this.next = 0;
    91         this.set = false;
    92         this.kernel_alarm = false;
    93 }
    94 
    95 void ?{}( alarm_node_t & this, processor   * proc, __cfa_time_t alarm = zero_time, __cfa_time_t period = zero_time ) {
     90        next = 0;
     91        set = false;
     92        kernel_alarm = false;
     93}
     94
     95void ?{}( alarm_node_t & this, processor   * proc, __cfa_time_t alarm = zero_time, __cfa_time_t period = zero_time ) with( this ) {
    9696        this.proc = proc;
    9797        this.alarm = alarm;
    9898        this.period = period;
    99         this.next = 0;
    100         this.set = false;
    101         this.kernel_alarm = true;
     99        next = 0;
     100        set = false;
     101        kernel_alarm = true;
    102102}
    103103
  • src/libcfa/concurrency/alarm.h

    reb7f20c rc40e7c5  
    114114};
    115115
    116 static inline void ?{}( alarm_list_t & this ) {
    117         this.head = 0;
    118         this.tail = &this.head;
     116static inline void ?{}( alarm_list_t & this ) with( this ) {
     117        head = 0;
     118        tail = &head;
    119119}
    120120
  • src/libcfa/concurrency/coroutine.c

    reb7f20c rc40e7c5  
    3939//-----------------------------------------------------------------------------
    4040// Coroutine ctors and dtors
    41 void ?{}(coStack_t& this) {
    42         this.size               = 65000;        // size of stack
    43         this.storage    = NULL; // pointer to stack
    44         this.limit              = NULL; // stack grows towards stack limit
    45         this.base               = NULL; // base of stack
    46         this.context    = NULL; // address of cfa_context_t
    47         this.top                = NULL; // address of top of storage
    48         this.userStack  = false;
     41void ?{}(coStack_t& this) with( this ) {
     42        size            = 65000;        // size of stack
     43        storage = NULL; // pointer to stack
     44        limit           = NULL; // stack grows towards stack limit
     45        base            = NULL; // base of stack
     46        context = NULL; // address of cfa_context_t
     47        top             = NULL; // address of top of storage
     48        userStack       = false;
    4949}
    5050
     
    6060}
    6161
    62 void ?{}(coroutine_desc& this, const char * name) {
     62void ?{}(coroutine_desc& this, const char * name) with( this ) {
    6363        this.name = name;
    64         this.errno_ = 0;
    65         this.state = Start;
    66         this.starter = NULL;
    67         this.last = NULL;
     64        errno_ = 0;
     65        state = Start;
     66        starter = NULL;
     67        last = NULL;
    6868}
    6969
  • src/libcfa/concurrency/kernel.c

    reb7f20c rc40e7c5  
    144144}
    145145
    146 void ?{}(processor & this, cluster * cltr) {
     146void ?{}(processor & this, cluster * cltr) with( this ) {
    147147        this.cltr = cltr;
    148         this.terminated{ 0 };
    149         this.do_terminate = false;
    150         this.preemption_alarm = NULL;
    151         this.pending_preemption = false;
     148        terminated{ 0 };
     149        do_terminate = false;
     150        preemption_alarm = NULL;
     151        pending_preemption = false;
    152152
    153153        start( &this );
    154154}
    155155
    156 void ?{}(processor & this, cluster * cltr, processorCtx_t & runner) {
     156void ?{}(processor & this, cluster * cltr, processorCtx_t & runner) with( this ) {
    157157        this.cltr = cltr;
    158         this.terminated{ 0 };
    159         this.do_terminate = false;
    160         this.preemption_alarm = NULL;
    161         this.pending_preemption = false;
    162         this.kernel_thread = pthread_self();
     158        terminated{ 0 };
     159        do_terminate = false;
     160        preemption_alarm = NULL;
     161        pending_preemption = false;
     162        kernel_thread = pthread_self();
    163163
    164164        this.runner = &runner;
  • src/libcfa/concurrency/monitor

    reb7f20c rc40e7c5  
    2727};
    2828
    29 static inline void ?{}(monitor_desc & this) {
    30         (this.lock){};
    31         (this.entry_queue){};
    32         (this.signal_stack){};
    33         this.owner         = NULL;
    34         this.recursion     = 0;
    35         this.mask.accepted = NULL;
    36         this.mask.data     = NULL;
    37         this.mask.size     = 0;
    38         this.dtor_node     = NULL;
     29static inline void ?{}(monitor_desc & this) with( this ) {
     30        lock{};
     31        entry_queue{};
     32        signal_stack{};
     33        owner         = NULL;
     34        recursion     = 0;
     35        mask.accepted = NULL;
     36        mask.data     = NULL;
     37        mask.size     = 0;
     38        dtor_node     = NULL;
    3939}
    4040
  • src/libcfa/concurrency/monitor.c

    reb7f20c rc40e7c5  
    358358}
    359359
    360 void ?{}(__condition_criterion_t & this ) {
    361         this.ready  = false;
    362         this.target = NULL;
    363         this.owner  = NULL;
    364         this.next   = NULL;
     360void ?{}(__condition_criterion_t & this ) with( this ) {
     361        ready  = false;
     362        target = NULL;
     363        owner  = NULL;
     364        next   = NULL;
    365365}
    366366
Note: See TracChangeset for help on using the changeset viewer.