Make variables shared between threads atomic 44/277444/2
authorSuyeon Hwang <stom.hwang@samsung.com>
Thu, 7 Jul 2022 05:59:58 +0000 (14:59 +0900)
committerSuyeon Hwang <stom.hwang@samsung.com>
Mon, 25 Jul 2022 00:51:57 +0000 (09:51 +0900)
commit7698e3c1dffbb7c942fc9c4d3057e68bbaa68798
tree07edc31e3a72895120528071c9bc0d501ab6914e
parenta4bd57c288a392cf5dc713593f3d6cb682867325
Make variables shared between threads atomic

- Issue:
Some variables that are shared between threads are defined with 'volatile'
keyword for preventing race condition. However 'volatile' can not assure
preventing race condition.

- Solution:
'volatile' just prevents compiler optimization, not prevent race
condition between threads. To assure thread safety, we should use atomic
variable.
This patch fixes the definition of those variable into atomic variables.
Through this patch, each variables will be created as atomic variables
and these atomic varaibles can prevent race condition during multi
threads enviroment.

Change-Id: I71f254a62d7ac848fedeffc91c40e4271f7af25d
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
client/tts_core.c
client/tts_dbus.c
server/ttsd_player.cpp