[Issue 21281] New: Fiber.state race condition

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Sep 27 13:10:25 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=21281

          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 at puremagic.com
          Reporter: destructionator at gmail.com

The implementation of Fiber.yield does:

        cur.m_state = State.HOLD;
        cur.switchOut();
        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.

--


More information about the Digitalmars-d-bugs mailing list