Ignore:
Timestamp:
May 2, 2018, 5:38:06 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:
d28a03e, fb16d5c
Parents:
9d32bc8
Message:

Added more checks to preempt test to make sure preemption stays enabled

File:
1 edited

Legend:

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

    r9d32bc8 rb68fc85  
    404404}
    405405
     406//=============================================================================================
     407// Kernel Signal Debug
     408//=============================================================================================
     409
     410void __cfaabi_check_preemption() {
     411        bool ready = TL_GET( preemption_state ).enabled;
     412        if(!ready) { abort("Preemption should be ready"); }
     413
     414        sigset_t oldset;
     415        int ret;
     416        ret = sigprocmask(0, NULL, &oldset);
     417        if(ret != 0) { abort("ERROR sigprocmask returned %d", ret); }
     418
     419        ret = sigismember(&oldset, SIGUSR1);
     420        if(ret <  0) { abort("ERROR sigismember returned %d", ret); }
     421
     422        if(ret == 1) { abort("ERROR SIGUSR1 is disabled"); }
     423}
     424
    406425// Local Variables: //
    407426// mode: c //
Note: See TracChangeset for help on using the changeset viewer.