Make NS Consumer message handler thread as joinable thread. 42/212242/1
authorSenthil Kumar G S <senthil.gs@samsung.com>
Thu, 8 Aug 2019 15:09:23 +0000 (20:39 +0530)
committerSudipto Bal <sudipto.bal@samsung.com>
Mon, 19 Aug 2019 07:53:52 +0000 (07:53 +0000)
commit8181b88c9eb6b2b45708e5e6c124ad2a79ff1b90
tree2c41232a38ddc925c72f071e6c38dfb7c2065c3f
parentc40b239959b7b7d012dc45913718edb19811e163
Make NS Consumer message handler thread as joinable thread.

Background:
Currently, NS Consumer message handler thread is a detached thread.
When stopping NS Consumer, we have to destroy thread handle and other resources of message handler thread.
We cannot destroy if message handler thread is running.
So before we destroy, we need to wait for the message handler thread to terminate.
pthread_join() is called internally. As it is on a detached thread, it is useless and it could result in undefined behavior.

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/commit/93e66a00acc08ce0c7a3fb217bfb2cc92f2a6c15
(cherry-picked from 93e66a00acc08ce0c7a3fb217bfb2cc92f2a6c15)

Change-Id: I43113a1d6ac0dcbba15a6b12032d71c5369e8b3b
Signed-off-by: Senthil Kumar G S <senthil.gs@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
service/notification/src/consumer/NSConsumerScheduler.c
service/notification/src/consumer/NSThread.c
service/notification/src/consumer/NSThread.h