After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 90195 - make it somewhat more portable
make it somewhat more portable
Status: RESOLVED FIXED
Product: memprof
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: MemProf Maintainers
MemProf Maintainers
Depends on:
Blocks:
 
 
Reported: 2002-08-08 10:42 UTC by Michael Meeks
Modified: 2005-01-25 20:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
portability patch (9.11 KB, patch)
2002-08-08 11:47 UTC, Michael Meeks
none Details | Review

Description Michael Meeks 2002-08-08 10:42:32 UTC
As above, a noddy patch - in-line:

+2002-08-08  Michael Meeks  <michael@ximian.com>
+
+       * memintercept.c: switch to gthread for Solaris.
+
 Tue Aug  6 21:14:00 2002  Owen Taylor  <otaylor@redhat.com>
 
        * memintercept.c (debug): Add a mini-printf implementation, use
Index: memintercept.c
===================================================================
RCS file: /cvs/gnome/memprof/memintercept.c,v
retrieving revision 1.15
diff -u -p -u -r1.15 memintercept.c
--- memintercept.c      8 Aug 2002 01:32:55 -0000       1.15
+++ memintercept.c      8 Aug 2002 10:41:57 -0000
@@ -33,7 +33,7 @@
 #include <stdarg.h>
 #include "memintercept.h"
 
-#include <pthread.h>
+#include <glib/gthread.h>
 
 #include <sys/socket.h>
 #include <sys/types.h>
@@ -59,7 +59,7 @@ static void (*old__exit) (int status);
 
 #define MAX_THREADS 128
 
-static pthread_mutex_t malloc_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
+static GStaticRecMutex malloc_mutex = G_STATIC_REC_MUTEX_INIT;
 static int tracing = 1;
 
 static int pids[MAX_THREADS];
@@ -74,8 +74,8 @@ int starter_last = 0;
 
 #undef ENABLE_DEBUG
 
-#define MI_LOCK() pthread_mutex_lock (&malloc_mutex);
-#define MI_UNLOCK() pthread_mutex_unlock (&malloc_mutex);
+#define MI_LOCK() g_static_rec_mutex_lock (&malloc_mutex);
+#define MI_UNLOCK() g_static_rec_mutex_unlock (&malloc_mutex);
 
 static void
 abort_unitialized (const char *call)
Comment 1 Michael Meeks 2002-08-08 11:47:06 UTC
So it appears that it's a larger task than I expected, but
nevertheless the attached patch makes it at least build and link on
Linux and Solaris. Lots of interesting mixed pointer length stuff
needs doing too I'd guess.
Comment 2 Michael Meeks 2002-08-08 11:47:42 UTC
Created attachment 10360 [details] [review]
portability patch
Comment 3 Owen Taylor 2002-08-31 18:29:33 UTC
Reassigning to memprof-maint alias
Comment 4 Kjartan Maraas 2005-01-25 20:04:33 UTC
No trace of pthreads in the current code. Closing.