diff options
author | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2015-06-10 11:14:20 +0200 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2015-06-10 09:10:59 +0200 |
commit | 477870f88026110b6a73d83aadc7f96d3bbd314e (patch) | |
tree | 5aae93cc53ba41ef987a876bf92033099d48cd0f /src | |
parent | ebad530a9c393cfe34a6cbd6e6b35bc3785268dc (diff) | |
download | uca-477870f88026110b6a73d83aadc7f96d3bbd314e.tar.gz uca-477870f88026110b6a73d83aadc7f96d3bbd314e.tar.bz2 uca-477870f88026110b6a73d83aadc7f96d3bbd314e.tar.xz uca-477870f88026110b6a73d83aadc7f96d3bbd314e.zip |
pco: fix deadlock with streamed acquisition
Diffstat (limited to 'src')
-rw-r--r-- | src/uca-camera.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/uca-camera.c b/src/uca-camera.c index 98d4373..788471c 100644 --- a/src/uca-camera.c +++ b/src/uca-camera.c @@ -1015,26 +1015,28 @@ uca_camera_grab (UcaCamera *camera, gpointer data, GError **error) "Camera is neither recording nor in readout mode"); } else { - g_static_mutex_lock (&access_lock); - #ifdef WITH_PYTHON_MULTITHREADING if (Py_IsInitialized ()) { PyGILState_STATE state = PyGILState_Ensure (); Py_BEGIN_ALLOW_THREADS + g_static_mutex_lock (&access_lock); result = (*klass->grab) (camera, data, error); + g_static_mutex_unlock (&access_lock); Py_END_ALLOW_THREADS PyGILState_Release (state); } else { + g_static_mutex_lock (&access_lock); result = (*klass->grab) (camera, data, error); + g_static_mutex_unlock (&access_lock); } #else + g_static_mutex_lock (&access_lock); result = (*klass->grab) (camera, data, error); -#endif - g_static_mutex_unlock (&access_lock); +#endif } g_static_mutex_unlock (&mutex); |