For the readability and to prevent mistakes in the future,
- Apply symmetricity to lock/unlock, hide magic lock from programmers
- Apply common ops into macro
Signed-off-by: MyungJoo Ham <email address hidden>
[Tests/Plugins] Avoid warnings caused by a GCC bug related to gtest
A GCC bug [1] might cause warnings related to 'conversion-null' when
using googletest macros with !FALSE as arguments. Therefore, in the case
that Werror is true, the build would be broken by this bug. To avoid
such situation, this patch replaces EXPECT_EQs in the plugin unit tests
with EXPECT_TRUE or EXPECT_FALSE.
ae8c224...
by
Parichay Kapoor <email address hidden>
[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