[single] Thread safety bug fix
authorParichay Kapoor <pk.kapoor@samsung.com>
Thu, 19 Sep 2019 03:56:34 +0000 (12:56 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Thu, 19 Sep 2019 10:03:08 +0000 (19:03 +0900)
commitae8c2245e71fb4d0fb46233afdc304ede0f7da17
tree750abec767383786d4b1c5663e5d6130af7d9c17
parent89a16ac69a1c887d40e636c1717d45db2be75095
[single] Thread safety bug fix

Added bug fix for thread safe usage
Single shot API use single handle lock for making all its API call thread safe
However, the call to close the API destroys the handle itself making the
call to close not thread safe
Added a global lock to make closing of handles thread safe

Further, all the single handle locks are acquired inside the global lock
to ensure that single handle is not closed while the magic has been verified
and the local lock is not acquired

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
api/capi/src/nnstreamer-capi-single-new.c
api/capi/src/nnstreamer-capi-single.c