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