summaryrefslogtreecommitdiffstats
path: root/src/uca-camera.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/uca-camera.c')
-rw-r--r--src/uca-camera.c10
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);