www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21281] New: Fiber.state race condition


          Issue ID: 21281
           Summary: Fiber.state race condition
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: destructionator gmail.com

The implementation of Fiber.yield does:

        cur.m_state = State.HOLD;
        cur.m_state = State.EXEC;

This makes it useless for threaded work, the state of HOLD is set before it
actually starts holding and another thread can corrupt it.

Sep 27 2020