# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1045598944 0 # Node ID 403b07f873e1322b58552adab34a4d85a62e983d # Parent 13d3de3f1e837bfe4984dec215cdd216917eaeec Use a pointer for HMTX instead of a pthread_mutex_t struct. diff -r 13d3de3f1e83 -r 403b07f873e1 dw.h --- a/dw.h Tue Feb 18 19:34:21 2003 +0000 +++ b/dw.h Tue Feb 18 20:09:04 2003 +0000 @@ -466,7 +466,7 @@ typedef char CHAR; typedef unsigned UINT; typedef int INT; -typedef pthread_mutex_t HMTX; +typedef pthread_mutex_t *HMTX; typedef struct _dw_unix_event { pthread_mutex_t mutex; pthread_cond_t event; diff -r 13d3de3f1e83 -r 403b07f873e1 gtk/dw.c --- a/gtk/dw.c Tue Feb 18 19:34:21 2003 +0000 +++ b/gtk/dw.c Tue Feb 18 20:09:04 2003 +0000 @@ -5257,9 +5257,9 @@ */ HMTX dw_mutex_new(void) { - HMTX mutex; - - pthread_mutex_init(&mutex, NULL); + HMTX mutex = malloc(sizeof(pthread_mutex_t)); + + pthread_mutex_init(mutex, NULL); return mutex; } @@ -5270,7 +5270,11 @@ */ void dw_mutex_close(HMTX mutex) { - pthread_mutex_destroy(&mutex); + if(mutex) + { + pthread_mutex_destroy(mutex); + free(mutex); + } } /* @@ -5286,7 +5290,7 @@ if(pthread_self() == _dw_thread) gdk_threads_leave(); - pthread_mutex_lock(&mutex); + pthread_mutex_lock(mutex); /* And of course relock it when we have acquired the mutext */ if(pthread_self() == _dw_thread) @@ -5300,7 +5304,7 @@ */ void dw_mutex_unlock(HMTX mutex) { - pthread_mutex_unlock(&mutex); + pthread_mutex_unlock(mutex); } /*