Ignore:
Timestamp:
Aug 23, 2017, 6:22:07 PM (8 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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:
87e08e24, cb811ac
Parents:
9f07232 (diff), bd37119 (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 plg2:software/cfa/cfa-cc

File:
1 edited

Legend:

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

    r9f07232 rd3e4d6c  
    139139}
    140140
    141 void ?{}( monitor_guard_t * this, monitor_desc ** m, int count ) {
    142         this->m = m;
    143         this->count = count;
    144         qsort(this->m, count);
    145         enter( this->m, this->count );
    146 
    147         this->prev_mntrs = this_thread->current_monitors;
    148         this->prev_count = this_thread->current_monitor_count;
     141void ?{}( monitor_guard_t & this, monitor_desc ** m, int count ) {
     142        this.m = m;
     143        this.count = count;
     144        qsort(this.m, count);
     145        enter( this.m, this.count );
     146
     147        this.prev_mntrs = this_thread->current_monitors;
     148        this.prev_count = this_thread->current_monitor_count;
    149149
    150150        this_thread->current_monitors      = m;
     
    152152}
    153153
    154 void ^?{}( monitor_guard_t * this ) {
    155         leave( this->m, this->count );
    156 
    157         this_thread->current_monitors      = this->prev_mntrs;
    158         this_thread->current_monitor_count = this->prev_count;
    159 }
    160 
    161 void ?{}(__condition_node_t * this, thread_desc * waiting_thread, unsigned short count, uintptr_t user_info ) {
    162         this->waiting_thread = waiting_thread;
    163         this->count = count;
    164         this->next = NULL;
    165         this->user_info = user_info;
    166 }
    167 
    168 void ?{}(__condition_criterion_t * this ) {
    169         this->ready  = false;
    170         this->target = NULL;
    171         this->owner  = NULL;
    172         this->next   = NULL;
    173 }
    174 
    175 void ?{}(__condition_criterion_t * this, monitor_desc * target, __condition_node_t * owner ) {
    176         this->ready  = false;
    177         this->target = target;
    178         this->owner  = owner;
    179         this->next   = NULL;
     154void ^?{}( monitor_guard_t & this ) {
     155        leave( this.m, this.count );
     156
     157        this_thread->current_monitors      = this.prev_mntrs;
     158        this_thread->current_monitor_count = this.prev_count;
     159}
     160
     161void ?{}(__condition_node_t & this, thread_desc * waiting_thread, unsigned short count, uintptr_t user_info ) {
     162        this.waiting_thread = waiting_thread;
     163        this.count = count;
     164        this.next = NULL;
     165        this.user_info = user_info;
     166}
     167
     168void ?{}(__condition_criterion_t & this ) {
     169        this.ready  = false;
     170        this.target = NULL;
     171        this.owner  = NULL;
     172        this.next   = NULL;
     173}
     174
     175void ?{}(__condition_criterion_t & this, monitor_desc * target, __condition_node_t * owner ) {
     176        this.ready  = false;
     177        this.target = target;
     178        this.owner  = owner;
     179        this.next   = NULL;
    180180}
    181181
     
    202202        __condition_criterion_t criteria[count];
    203203        for(int i = 0; i < count; i++) {
    204                 (&criteria[i]){ this->monitors[i], &waiter };
     204                (criteria[i]){ this->monitors[i], &waiter };
    205205                // LIB_DEBUG_PRINT_SAFE( "Criterion %p\n", &criteria[i] );
    206206        }
     
    314314        __condition_criterion_t criteria[count];
    315315        for(int i = 0; i < count; i++) {
    316                 (&criteria[i]){ this->monitors[i], &waiter };
     316                (criteria[i]){ this->monitors[i], &waiter };
    317317                // LIB_DEBUG_PRINT_SAFE( "Criterion %p\n", &criteria[i] );
    318318                push( &criteria[i].target->signal_stack, &criteria[i] );
     
    505505}
    506506
    507 void ?{}( __condition_blocked_queue_t * this ) {
    508         this->head = NULL;
    509         this->tail = &this->head;
     507void ?{}( __condition_blocked_queue_t & this ) {
     508        this.head = NULL;
     509        this.tail = &this.head;
    510510}
    511511
Note: See TracChangeset for help on using the changeset viewer.