Destroy tts handle always on the main thread 49/288549/1 accepted/tizen/unified/20230221.085046
authorSuyeon Hwang <stom.hwang@samsung.com>
Mon, 20 Feb 2023 02:13:24 +0000 (11:13 +0900)
committerSuyeon Hwang <stom.hwang@samsung.com>
Mon, 20 Feb 2023 02:13:24 +0000 (11:13 +0900)
commitfc9fbc084158df81c527568df3af343caf75cd4e
treeb4e639a7be33cb132da980c2f9bab910b87fee05
parente85c5c33aa5afd4a0b67a8543a435e23f7485a39
Destroy tts handle always on the main thread

- Issue:
In C# application, the garbage colletor can destroy tts handle on a sub
thread, and this behavior can make thread safety issues.

- Solution:
The C# garbage collector can release the instance on a sub thread, so
this can make race condition issues. To prevent this kind of issues,
this patch adds a new logic to tts_destroy() function. Through this
change, the handle destruction logic of tts_destroy() will always be
run on a main thread. This change will prevent race condition issues
because the logic insures that every handle destructions are run on a
main thread and they are not destroyed at the same time.

Change-Id: I90c248a4975410d4211dea93f24ea43e7c00ecb1
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
client/tts.c