summaryrefslogtreecommitdiff
path: root/modules/sensors/dynamic_sensor/DynamicSensorManager.cpp
diff options
context:
space:
mode:
authorSergii Piatakov <sergii.piatakov@globallogic.com>2018-08-02 12:41:11 +0300
committerSergii Piatakov <sergii.piatakov@globallogic.com>2018-10-17 09:52:09 +0300
commit48ac84b8be9f527ba8a70bb1caf8449bab6ce2c8 (patch)
treeff777527714f3469f3d05d0c07d1ae094a1388de /modules/sensors/dynamic_sensor/DynamicSensorManager.cpp
parenteef57caed9af7541d4cf8a8c694a808b5e039bf7 (diff)
camera: add a lock for the request tracker
The request tracker manages "in flights" buffers and frames. These two containers are modified by calling the tracker's member functions. Such functions are called from at least three threads: (see `v4l2_camera.cpp` for more details): - "main" thread; - separate buffer enqueue thread ("Enqueue buffers"); - separate buffer dequeue thread ("Dequeue buffers"). It is proposed to introduce additional mutex for the request tracker to prevent a race condition. An alternative approach is introducing an additional mutex for the shared containers inside the `RequresTracker` class. But such approach requires more changes and may lead to problems with design in the future. This commit contains a few additional changes which are not directly related to the topic: - as far as more than one local lock is used all of them are renamed; - the `mFlushLock` member is removed because it is completely covered by the new mutex. Test: try to use a camera with more than one buffer and get SIGSEGV crash of the `cameraserver` in the `RequestTracker` class. Change-Id: I2c1901722289cee9f0cb05a11a4dabe70d18f2ba Signed-off-by: Sergii Piatakov <sergii.piatakov@globallogic.com>
Diffstat (limited to 'modules/sensors/dynamic_sensor/DynamicSensorManager.cpp')
0 files changed, 0 insertions, 0 deletions