fiber: don't crash on wakeup with dead fibers
When fiber has finished its work it ended up in two cases:
1) If no "joinable" attribute set then the fiber is
simply recycled
2) Otherwise it continue hanging around waiting to be
joined.
Our API allows to call fiber_wakeup() for dead but joinable
fibers (2) in release builds without any side effects, such
fibers are simply ignored, in turn for debug builds this
causes assertion to trigger. We can't change our API for
backward compatibility sake but same time we must not
preserve different behaviour between release and debug
builds since this brings inconsistency. Thus lets get
rid of assertion call and allow to call fiber_wakeup
in debug build as well.
Fixes #5843
NO_DOC=bug fix
Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com>
Showing
- changelogs/unreleased/gh-5843-fiber-wakeup.md 6 additions, 0 deletionschangelogs/unreleased/gh-5843-fiber-wakeup.md
- src/lib/core/fiber.c 8 additions, 7 deletionssrc/lib/core/fiber.c
- test/unit/fiber.cc 16 additions, 0 deletionstest/unit/fiber.cc
- test/unit/fiber.result 2 additions, 0 deletionstest/unit/fiber.result
Loading
Please register or sign in to comment