util: thread: Prevent to run thread before creation finished 18/287918/4 accepted/tizen/unified/20230221.031435
authorDongwoo Lee <dwoo08.lee@samsung.com>
Tue, 7 Feb 2023 16:50:33 +0000 (08:50 -0800)
committerDongwoo Lee <dwoo08.lee@samsung.com>
Wed, 8 Feb 2023 06:03:59 +0000 (15:03 +0900)
commitdc02f09809ee3d7b3e7a1eeabb2828bc06f91f32
treea4bdfe156910857f3817d542972eaea66c1e4057
parent561e63159e9acffdf642198c233dc444b56dc015
util: thread: Prevent to run thread before creation finished

Currently thread can be terminated before creation process is over,
and it can either cause wrong memory access on thread context. To
prevent this situation, thread lock is acquired before creating
thread, and thus the new thread cannot acquire lock and is suspended
until lock is released after creation is over.

Change-Id: Ic769c4dfa522e115959cf25c2c0c78779d176743
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
src/util/thread.c