a4335feb6d
Add a flag resched to check if reschedule operation is requested to struct spdk_lw_thread. Add _reactor_resquest_thread_reschedule() to set the resched flag, and add it to the case SPDK_THREAD_OP_RESCHED in spdk_reactor_thread_op(), and return true in the case SPDK_THREAD_OP_RESCHED in spdk_reactor_thread_op_supported(). Then _spdk_reactor_run() checks if the resched flag is true for each thread. If true, set the resched flag to false, and remove the thread and call _reactor_schedule_thread(). Add continue to avoid use-after-free issue for both reschedule and terminate cases. This idea follows voluntary thread termination and will remove our worries for all complicated rare cases. Add unit test case to verify this update. Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Change-Id: I656872d32dbb469ae70f771cd0419a77236bfe18 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/500 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> |
||
---|---|---|
.. | ||
include | ||
lib | ||
Makefile | ||
unittest.sh |