Allows to access it safely from different threads. Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx> --- server/red-client.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/red-client.c b/server/red-client.c index 666903e3..3ce09e33 100644 --- a/server/red-client.c +++ b/server/red-client.c @@ -347,12 +347,18 @@ gboolean red_client_seamless_migration_done_for_channel(RedClient *client) gboolean red_client_is_disconnecting(RedClient *client) { - return client->disconnecting; + gboolean ret; + pthread_mutex_lock(&client->lock); + ret = client->disconnecting; + pthread_mutex_unlock(&client->lock); + return ret; } void red_client_set_disconnecting(RedClient *client) { + pthread_mutex_lock(&client->lock); client->disconnecting = TRUE; + pthread_mutex_unlock(&client->lock); } RedsState *red_client_get_server(RedClient *client) -- 2.13.5 _______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel