|
Line 0
Link Here
|
|
|
1 |
From 30ac9e68208eadd0faee8e51def56b15204c8c35 Mon Sep 17 00:00:00 2001 |
| 2 |
From: Georg Gast <georg@schorsch-tech.de> |
| 3 |
Date: Thu, 23 Apr 2015 20:54:03 +0200 |
| 4 |
Subject: [PATCH] mutex |
| 5 |
|
| 6 |
--- |
| 7 |
debugger/src/dconfig.c | 2 ++ |
| 8 |
1 file changed, 2 insertions(+) |
| 9 |
|
| 10 |
diff --git a/debugger/src/dconfig.c b/debugger/src/dconfig.c |
| 11 |
index 97e7bab..d09f235 100644 |
| 12 |
--- a/debugger/src/dconfig.c |
| 13 |
+++ b/debugger/src/dconfig.c |
| 14 |
@@ -271,6 +271,7 @@ static gpointer saving_thread_func(gpointer data) |
| 15 |
{ |
| 16 |
GTimeVal interval; |
| 17 |
GMutex *m = g_mutex_new(); |
| 18 |
+ g_mutex_lock(m); |
| 19 |
do |
| 20 |
{ |
| 21 |
g_mutex_lock(change_config_mutex); |
| 22 |
@@ -316,6 +317,7 @@ static gpointer saving_thread_func(gpointer data) |
| 23 |
g_time_val_add(&interval, SAVING_INTERVAL); |
| 24 |
} |
| 25 |
while (!g_cond_timed_wait(cond, m, &interval)); |
| 26 |
+ g_mutex_unlock(m); |
| 27 |
g_mutex_free(m); |
| 28 |
|
| 29 |
return NULL; |
| 30 |
-- |
| 31 |
2.0.5 |