[Datacontrol] Prevent possible race conditions 51/246051/2
authorPawel Wasowski <p.wasowski2@samsung.com>
Wed, 21 Oct 2020 03:15:01 +0000 (05:15 +0200)
committerPawel Wasowski <p.wasowski2@samsung.com>
Wed, 21 Oct 2020 11:37:18 +0000 (13:37 +0200)
commitb5fdee72497c8ca15728d626e3ba377a4789e49c
tree9a918538dd7d15d9db48af7da726e846f1f5cafc
parent57c7d321930c4240226a571818eea40c4f13934a
[Datacontrol] Prevent possible race conditions

DataconstrolInstance::reply_map is accessed in callbacks
that can run in threads other than that, which runs API calls.
This commit adds a mutex and proper locks to prevent race
conditions.

[Verification] tct-datacontrol-tizen-tests: 100% pass rate

Change-Id: I2573a59c36af3e12a0d5e77598b170192d24f225
Signed-off-by: Pawel Wasowski <p.wasowski2@samsung.com>
src/datacontrol/datacontrol_instance.cc
src/datacontrol/datacontrol_instance.h