summaryrefslogtreecommitdiffstats
path: root/recipes-extended/openhpi-subagent/files/glib_mutex.patch
blob: e22e655f4d038503f147ecedad9f2fdd0584b973 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Index: openhpi-subagent-2.3.4/include/hpiLock.h
===================================================================
--- openhpi-subagent-2.3.4.orig/include/hpiLock.h
+++ openhpi-subagent-2.3.4/include/hpiLock.h
@@ -26,7 +26,7 @@ extern "C" {
 #include <glib.h>
 
 typedef struct {
-      GStaticRecMutex thread_mutex;
+      GRecMutex thread_mutex;
       int lockcount;
 }hpi_lock_type;
 
Index: openhpi-subagent-2.3.4/src/hpiLock.c
===================================================================
--- openhpi-subagent-2.3.4.orig/src/hpiLock.c
+++ openhpi-subagent-2.3.4/src/hpiLock.c
@@ -21,7 +21,7 @@
 #include <net-snmp/library/snmp_debug.h>
 
 hpi_lock_type hpi_lock_data = {
-        .thread_mutex = G_STATIC_REC_MUTEX_INIT,
+        .thread_mutex = G_STATIC_MUTEX_INIT,
         .lockcount = 0
 };
 
@@ -29,12 +29,12 @@ hpi_lock_type hpi_lock_data = {
 void subagent_lock( hpi_lock_type * hpi_lock_data)                                                                           
 {                                                                                        
         
-	if (!g_static_rec_mutex_trylock(&hpi_lock_data->thread_mutex)) {                                    
+	if (!g_rec_mutex_trylock(&hpi_lock_data->thread_mutex)) {                                    
                 
 		DEBUGMSGTL ((AGENT, "********Going to block for a lock now. %p - lockcount %d\n", 
 		                                                   g_thread_self(), hpi_lock_data->lockcount));
 								   
-		g_static_rec_mutex_lock(&hpi_lock_data->thread_mutex);
+		g_rec_mutex_lock(&hpi_lock_data->thread_mutex);
                 
 		hpi_lock_data->lockcount++;
                 
@@ -57,7 +57,7 @@ void subagent_unlock( hpi_lock_type * hp
 	
 	hpi_lock_data->lockcount--;
         
-	g_static_rec_mutex_unlock(&hpi_lock_data->thread_mutex);
+	g_rec_mutex_unlock(&hpi_lock_data->thread_mutex);
         
 	DEBUGMSGTL ((AGENT,"Released the lock, %p - lockcount %d\n", 
 	                           g_thread_self(), hpi_lock_data->lockcount));