[gnome-remote-desktop/gnome-42] rdp/rdpgfx: Create RTT pause source while GFX mutex is locked
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-remote-desktop/gnome-42] rdp/rdpgfx: Create RTT pause source while GFX mutex is locked
- Date: Thu, 19 May 2022 18:36:09 +0000 (UTC)
commit a595a2967d43c2006f62bda03ccfb4bc27e757a4
Author: Pascal Nowack <Pascal Nowack gmx de>
Date: Tue May 17 12:27:43 2022 +0200
rdp/rdpgfx: Create RTT pause source while GFX mutex is locked
The RTT pause source callback runs in the graphics thread, which is not
the main thread.
To ensure no race conditions happen, create this source, while the GFX
mutex is locked.
src/grd-rdp-graphics-pipeline.c | 2 ++
1 file changed, 2 insertions(+)
---
diff --git a/src/grd-rdp-graphics-pipeline.c b/src/grd-rdp-graphics-pipeline.c
index 88535d28..3884236f 100644
--- a/src/grd-rdp-graphics-pipeline.c
+++ b/src/grd-rdp-graphics-pipeline.c
@@ -1425,9 +1425,11 @@ grd_rdp_graphics_pipeline_new (GrdSessionRdp *session_rdp,
rdpgfx_context->rdpcontext = rdp_context;
rdpgfx_context->custom = graphics_pipeline;
+ g_mutex_lock (&graphics_pipeline->gfx_mutex);
if (rdp_context->settings->NetworkAutoDetect &&
!graphics_pipeline->rtt_pause_source)
ensure_rtt_receivement (graphics_pipeline);
+ g_mutex_unlock (&graphics_pipeline->gfx_mutex);
return graphics_pipeline;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]