Changeset 32a8b61


Ignore:
Timestamp:
Nov 23, 2020, 5:10:23 PM (3 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:
0bb691b1
Parents:
b2e0df3
Message:

Tentative fix for the recurring crash, caching the current cluster to avoid re-reading for a pointer that could have been invalidated.

File:
1 edited

Legend:

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

    rb2e0df3 r32a8b61  
    379379
    380380        ready_schedule_lock();
    381                 push( thrd->curr_cluster, thrd );
    382                 __wake_one(thrd->curr_cluster);
     381                // Dereference the thread now because once we push it, there is not guaranteed it's still valid.
     382                struct cluster * cl = thrd->curr_cluster;
     383
     384                // push the thread to the cluster ready-queue
     385                push( cl, thrd );
     386
     387                // variable thrd is no longer safe to use
     388
     389                // wake the cluster using the save variable.
     390                __wake_one( cl );
    383391        ready_schedule_unlock();
    384392
Note: See TracChangeset for help on using the changeset viewer.