fiber: introduce cord_cancel_and_join()
It is a wrapper around pthread cancel and join. It was repeated many times and was dangerous, because left cord.id set. An accidental attempt to cord_join/cojoin() such cord would lead to UB then. The patch introduces a function which encapsulates the blocking cancellation. It is going to be used in a next patch to count the number of cords in the process. Which in turn is needed for a new test. The counter is atomic in case some cords would be created not by the main cord. There are now also more sanity checks against accidental attempts to join the same cord twice. Needed for #7743 NO_DOC=internal NO_CHANGELOG=internal
Showing
- src/box/applier.cc 1 addition, 2 deletionssrc/box/applier.cc
- src/box/iproto.cc 1 addition, 2 deletionssrc/box/iproto.cc
- src/box/memtx_engine.cc 3 additions, 6 deletionssrc/box/memtx_engine.cc
- src/box/relay.cc 7 additions, 9 deletionssrc/box/relay.cc
- src/box/vy_run.c 1 addition, 2 deletionssrc/box/vy_run.c
- src/box/vy_scheduler.c 1 addition, 2 deletionssrc/box/vy_scheduler.c
- src/lib/core/fiber.c 38 additions, 2 deletionssrc/lib/core/fiber.c
- src/lib/core/fiber.h 9 additions, 0 deletionssrc/lib/core/fiber.h
- test/unit/cbus_hang.c 1 addition, 1 deletiontest/unit/cbus_hang.c
- test/unit/fiber.cc 33 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