Fix critical section for checking thread status 78/261078/2 accepted/tizen/unified/20210716.131354 submit/tizen/20210709.113558 submit/tizen/20210714.093154
authorSuyeon Hwang <stom.hwang@samsung.com>
Fri, 9 Jul 2021 08:52:36 +0000 (17:52 +0900)
committerSuyeon Hwang <stom.hwang@samsung.com>
Fri, 9 Jul 2021 11:12:55 +0000 (20:12 +0900)
commit5bacb99ec29ae0da9f15ed3add2e1a46bae2d4b1
tree946f333956bf7531e621f11f5049221572b75ebe
parent77c85b8eca32bc70b40af29b6e921d7bf5792eda
Fix critical section for checking thread status

If there are multi client handles exist, uid that wants to stop or pause can be different from uid
that is played on sub thread.
However, previous code always checks thread status although uid is not the same as played uid.
If it is different, 'ttsd_player_stop()' does not stop the thread because the uid is not
playing.
By this thread status check, deadlock can occur.

This patch makes critical section for checking thread status only when 'g_playing_info' is set as
NULL. 'g_playing_info' becomes NULL means that play thread should stop.

Change-Id: I3d073d2ea49fb5d139ce6f2a2865c168538be3ef
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
server/ttsd_player.c