Remove unnecessary variables for controlling thread 11/304211/1
authorSuyeon Hwang <stom.hwang@samsung.com>
Fri, 12 Jan 2024 05:53:34 +0000 (14:53 +0900)
committerSuyeon Hwang <stom.hwang@samsung.com>
Fri, 12 Jan 2024 05:53:34 +0000 (14:53 +0900)
commitb553874efef99101e2052038956332bf1f010cc4
tree0d8b55d83769623ebc0528faef309430dc003b4e
parent76ba9cc3d05b1a536b79968375c0068090eade9e
Remove unnecessary variables for controlling thread

- Issue:
When PlayerThread is destructing, main thread can be in deadlock.

- Solution:
This patch removes unnecessary condition variable and mutex for thread.
The root cause of the deadlock is because of the wrong usage of two
different mutex for controlling single thread. This patch simplifies the
thread function and thread controlling logic using timed_mutex and
condition_variable_any. Through this change, the PlayerThread instance
can clear the reserved thread more quickly.

Change-Id: I8fa79f7c4e25595641fc651394e550d545360f75
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
server/PlayerThread.cpp
server/PlayerThread.h