Ignore:
Timestamp:
Nov 18, 2020, 2:28:02 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
69d1748
Parents:
9d6e1b8a
Message:

Added more checks for thread termination synchronization

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/thread.cfa

    r9d6e1b8a r3ea8ad1  
    8282                T & thrd, void(*defaultResumptionHandler)(ThreadCancelled(T) &)) {
    8383        $monitor * m = get_monitor(thrd);
     84        $thread * desc = get_thread(thrd);
     85
     86        // Setup the monitor guard
    8487        void (*dtor)(T& mutex this) = ^?{};
    8588        bool join = defaultResumptionHandler != (void(*)(ThreadCancelled(T)&))0;
    8689        (this.mg){&m, (void(*)())dtor, join};
    8790
     91
     92        /* paranoid */ verifyf( Halted == desc->state || Cancelled == desc->state, "Expected thread to be Halted or Cancelled, was %d\n", (int)desc->state );
     93
    8894        // After the guard set-up and any wait, check for cancellation.
    89         $thread * desc = get_thread(thrd);
    9095        struct _Unwind_Exception * cancellation = desc->self_cor.cancellation;
    9196        if ( likely( 0p == cancellation ) ) {
Note: See TracChangeset for help on using the changeset viewer.