Changeset 5510027


Ignore:
Timestamp:
Jun 5, 2018, 3:32:43 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, with_gc
Children:
dafdbe7
Parents:
d885a58
Message:

Improved assertions on halting/waking processors

File:
1 edited

Legend:

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

    rd885a58 r5510027  
    663663        __cfaabi_dbg_print_safe("Kernel : Processor %p ready to sleep\n", this);
    664664
    665         verify( ({int sval = 0; sem_getvalue(&this->idleLock, &sval); sval; }) < 65536);
    666         sem_wait(&idleLock);
     665        verify( ({int sval = 0; sem_getvalue(&this->idleLock, &sval); sval; }) < 200);
     666        int __attribute__((unused)) ret = sem_wait(&idleLock);
     667        verify(ret > 0 || errno == EINTR);
    667668
    668669        __cfaabi_dbg_print_safe("Kernel : Processor %p woke up and ready to run\n", this);
     
    678679void wake(processor * this) {
    679680        __cfaabi_dbg_print_safe("Kernel : Waking up processor %p\n", this);
    680         sem_post(&this->idleLock);
    681         verify( ({int sval = 0; sem_getvalue(&this->idleLock, &sval); sval; }) < 65536);
     681        int __attribute__((unused)) ret = sem_post(&this->idleLock);
     682        verify(ret > 0 || errno == EINTR);
     683        verify( ({int sval = 0; sem_getvalue(&this->idleLock, &sval); sval; }) < 200);
    682684}
    683685
Note: See TracChangeset for help on using the changeset viewer.