Crash in CATerminate
The variable caglobals.tcp.terminate is used to signal the
receiver thread to stop. However using a volatile variable
to synchronize between threads is undefined behaviour as
per the C/C++ standards. In this particular case due to
cache coherence behaviour on SMP mobile(especially ARM)
multi core processors, the receiver thread is not guaranteed
to see the change to the terminate variable as soon as
adapter is terminated and this delay could cause an ANR.
https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/290
(cherry picked from commit
38101be161271b68cee847748d71fb4ded73bc5a)
Change-Id: I10cc6b0e540c4f3e68b6019f8ca8a6ebfc43b1b0
Signed-off-by: Veeraj Khokale <veeraj.sk@samsung.com>
Signed-off-by: Amit KS <amit.s12@samsung.com>