[gnome-remote-desktop] rdp/rdpgfx: Create RTT pause source while GFX mutex is locked



commit ac0706948ce957c68da06a03686016a0571d5b6e
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]