• Simon Marlow's avatar
    Fix race condition in wakeupThreadOnCapability() (#2574) · d572aed6
    Simon Marlow authored
    wakeupThreadOnCapbility() is used to signal another capability that
    there is a thread waiting to be added to its run queue.  It adds the
    thread to the (locked) wakeup queue on the remote capability.  In
    order to do this, it has to modify the TSO's link field, which has a
    write barrier.  The write barrier might put the TSO on the mutable
    list, and the bug was that it was using the mutable list of the
    *target* capability, which we do not have exclusive access to.  We
    should be using the current Capabilty's mutable list in this case.
Capability.h 8.86 KB