Ignore:
Timestamp:
Jun 16, 2017, 9:57:33 PM (7 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:
0b33412
Parents:
4e6fb8e (diff), 42b0d73 (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 plg.uwaterloo.ca:software/cfa/cfa-cc

Location:
src/libcfa/concurrency
Files:
6 edited

Legend:

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

    r4e6fb8e rec35498  
    136136
    137137static inline void remove_at( alarm_list_t * this, alarm_node_t * n, __alarm_it_t it ) {
    138         assert( it );
    139         assert( (*it) == n );
     138        verify( it );
     139        verify( (*it) == n );
    140140
    141141        (*it) = n->next;
  • src/libcfa/concurrency/coroutine

    r4e6fb8e rec35498  
    7171// Suspend implementation inlined for performance
    7272static inline void suspend() {
    73       coroutine_desc * src = this_coroutine();          // optimization
     73        coroutine_desc * src = this_coroutine();                // optimization
    7474
    7575        assertf( src->last != 0,
     
    9191        coroutine_desc * dst = get_coroutine(cor);
    9292
    93       if( unlikely(!dst->stack.base) ) {
     93        if( unlikely(!dst->stack.base) ) {
    9494                create_stack(&dst->stack, dst->stack.size);
    9595                CtxStart(cor, CtxInvokeCoroutine);
    9696        }
    9797
    98       // not resuming self ?
     98        // not resuming self ?
    9999        if ( src != dst ) {
    100100                assertf( dst->state != Halted ,
     
    103103                        src->name, src, dst->name, dst );
    104104
    105             // set last resumer
     105                // set last resumer
    106106                dst->last = src;
    107107        } // if
    108108
    109       // always done for performance testing
     109        // always done for performance testing
    110110        CoroutineCtxSwitch( src, dst );
    111111}
     
    114114        coroutine_desc * src = this_coroutine();                // optimization
    115115
    116       // not resuming self ?
     116        // not resuming self ?
    117117        if ( src != dst ) {
    118118                assertf( dst->state != Halted ,
     
    121121                        src->name, src, dst->name, dst );
    122122
    123             // set last resumer
     123                // set last resumer
    124124                dst->last = src;
    125125        } // if
    126126
    127       // always done for performance testing
     127        // always done for performance testing
    128128        CoroutineCtxSwitch( src, dst );
    129129}
  • src/libcfa/concurrency/kernel.c

    r4e6fb8e rec35498  
    322322        // appropriate stack.
    323323        proc_cor_storage.__cor.state = Active;
    324       main( &proc_cor_storage );
    325       proc_cor_storage.__cor.state = Halted;
     324        main( &proc_cor_storage );
     325        proc_cor_storage.__cor.state = Halted;
    326326
    327327        // Main routine of the core returned, the core is now fully terminated
     
    371371        if( !thrd ) return;
    372372
    373         assertf( thrd->next == NULL, "Expected null got %p", thrd->next );
     373        verifyf( thrd->next == NULL, "Expected null got %p", thrd->next );
    374374       
    375375        lock( &systemProcessor->proc.cltr->lock );
     
    650650
    651651void append( __thread_queue_t * this, thread_desc * t ) {
    652         assert(this->tail != NULL);
     652        verify(this->tail != NULL);
    653653        *this->tail = t;
    654654        this->tail = &t->next;
     
    672672
    673673void push( __condition_stack_t * this, __condition_criterion_t * t ) {
    674         assert( !t->next );
     674        verify( !t->next );
    675675        t->next = this->top;
    676676        this->top = t;
  • src/libcfa/concurrency/kernel_private.h

    r4e6fb8e rec35498  
    2222
    2323#include "alarm.h"
     24
     25#include "libhdr.h"
    2426
    2527//-----------------------------------------------------------------------------
  • src/libcfa/concurrency/monitor

    r4e6fb8e rec35498  
    2626static inline void ?{}(monitor_desc * this) {
    2727        this->owner = NULL;
    28       this->stack_owner = NULL;
     28        this->stack_owner = NULL;
    2929        this->recursion = 0;
    3030}
     
    3333        monitor_desc ** m;
    3434        int count;
    35       monitor_desc ** prev_mntrs;
    36       unsigned short  prev_count;
     35        monitor_desc ** prev_mntrs;
     36        unsigned short  prev_count;
    3737};
    3838
  • src/libcfa/concurrency/monitor.c

    r4e6fb8e rec35498  
    5656                else if( this->owner == thrd) {
    5757                        //We already have the monitor, just not how many times we took it
    58                         assert( this->recursion > 0 );
     58                        verify( this->recursion > 0 );
    5959                        this->recursion += 1;
    6060                }
     
    7878                lock( &this->lock );
    7979
    80                 thread_desc * thrd = this_thread();
    81 
    8280                LIB_DEBUG_PRINT_SAFE("%p Leaving %p (o: %p, r: %i)\n", thrd, this, this->owner, this->recursion);
    83                 assertf( thrd == this->owner, "Expected owner to be %p, got %p (r: %i)", thrd, this->owner, this->recursion );
     81                verifyf( this_thread() == this->owner, "Expected owner to be %p, got %p (r: %i)", this_thread(), this->owner, this->recursion );
    8482
    8583                //Leaving a recursion level, decrement the counter
     
    167165        //Check that everything is as expected
    168166        assertf( this->monitors != NULL, "Waiting with no monitors (%p)", this->monitors );
    169         assertf( this->monitor_count != 0, "Waiting with 0 monitors (%i)", this->monitor_count );
    170         assertf( this->monitor_count < 32u, "Excessive monitor count (%i)", this->monitor_count );
     167        verifyf( this->monitor_count != 0, "Waiting with 0 monitors (%i)", this->monitor_count );
     168        verifyf( this->monitor_count < 32u, "Excessive monitor count (%i)", this->monitor_count );
    171169
    172170        unsigned short count = this->monitor_count;
     
    229227
    230228        //Check that everything is as expected
    231         assert( this->monitors );
    232         assert( this->monitor_count != 0 );
     229        verify( this->monitors );
     230        verify( this->monitor_count != 0 );
    233231
    234232        unsigned short count = this->monitor_count;
     
    278276
    279277        //Check that everything is as expected
    280         assertf( this->monitors != NULL, "Waiting with no monitors (%p)", this->monitors );
    281         assertf( this->monitor_count != 0, "Waiting with 0 monitors (%i)", this->monitor_count );
     278        verifyf( this->monitors != NULL, "Waiting with no monitors (%p)", this->monitors );
     279        verifyf( this->monitor_count != 0, "Waiting with 0 monitors (%i)", this->monitor_count );
    282280
    283281        unsigned short count = this->monitor_count;
     
    327325
    328326uintptr_t front( condition * this ) {
    329         LIB_DEBUG_DO(
    330                 if( is_empty(this) ) {
    331                         abortf( "Attempt to access user data on an empty condition.\n"
    332                     "Possible cause is not checking if the condition is empty before reading stored data." );
    333                 }
     327        verifyf( !is_empty(this),
     328                "Attempt to access user data on an empty condition.\n"
     329                "Possible cause is not checking if the condition is empty before reading stored data."
    334330        );
    335331        return this->blocked.head->user_info;
     
    491487
    492488void append( __condition_blocked_queue_t * this, __condition_node_t * c ) {
    493         assert(this->tail != NULL);
     489        verify(this->tail != NULL);
    494490        *this->tail = c;
    495491        this->tail = &c->next;
Note: See TracChangeset for help on using the changeset viewer.