Mercurial > dwindows
diff gtk/dw.c @ 239:403b07f873e1
Use a pointer for HMTX instead of a pthread_mutex_t struct.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Tue, 18 Feb 2003 20:09:04 +0000 |
parents | efa724294b5f |
children | 00d2b1bcf036 |
line wrap: on
line diff
--- 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); } /*