From 477870f88026110b6a73d83aadc7f96d3bbd314e Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Wed, 10 Jun 2015 11:14:20 +0200 Subject: pco: fix deadlock with streamed acquisition --- src/uca-camera.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') 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); -- cgit v1.2.3