diff options
author | Russ Allbery <rra@debian.org> | 2015-04-26 19:09:49 -0700 |
---|---|---|
committer | Russ Allbery <rra@debian.org> | 2015-04-26 19:09:49 -0700 |
commit | d2aad177022072f2acc85d4651335b81ff448ed4 (patch) | |
tree | 90b4d9233bab83129f169d8bd72e68cb8fbf34ea /mtsupport.c | |
parent | 4fc50f48fa6f878421fed91d30f54520edfb384f (diff) |
Imported Upstream version 1.05.000
Diffstat (limited to 'mtsupport.c')
-rw-r--r-- | mtsupport.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/mtsupport.c b/mtsupport.c index a6c80de..3b04ba4 100644 --- a/mtsupport.c +++ b/mtsupport.c @@ -1,9 +1,9 @@ /* - * multithread.c + * mtsupport.c * * by Jon Kinsey, 2008 * - * Multithreaded operations + * Multithreaded support functions, moved out of multithread.c * * * This program is free software; you can redistribute it and/or modify @@ -19,7 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: mtsupport.c,v 1.6 2014/07/27 01:28:30 mdpetch Exp $ + * $Id: mtsupport.c,v 1.10 2015/01/17 21:56:19 mdpetch Exp $ */ #include "config.h" @@ -75,16 +75,15 @@ unsigned int mainThreadID; #if GLIB_CHECK_VERSION (2,32,0) static GMutex condMutex; /* Extra mutex needed for waiting */ #else -GMutex *condMutex = NULL; /* Extra mutex needed for waiting */ +static GMutex *condMutex = NULL; /* Extra mutex needed for waiting */ #endif -GAsyncQueue *async_queue = NULL; /* Needed for async waiting */ #endif #ifdef GLIB_THREADS #if GLIB_CHECK_VERSION (2,32,0) /* Dynamic allocation of GPrivate is deprecated */ -GPrivate private_item = G_PRIVATE_INIT (free); +static GPrivate private_item = G_PRIVATE_INIT(free); extern void TLSCreate(TLSItem * pItem) @@ -237,7 +236,7 @@ FreeMutex(Mutex * mutex) #endif extern void -Mutex_Lock(Mutex *mutex, const char *reason) +Mutex_Lock(Mutex * mutex, const char *reason) { #ifdef DEBUG_MULTITHREADED multi_debug(reason); @@ -252,7 +251,7 @@ Mutex_Lock(Mutex *mutex, const char *reason) } extern void -Mutex_Release(Mutex *mutex) +Mutex_Release(Mutex * mutex) { #ifdef DEBUG_MULTITHREADED multi_debug("Releasing lock"); @@ -480,6 +479,8 @@ multi_debug(const char *str, ...) printf("%s: %s\n", tn, buf); #endif + va_end(vl); + #ifdef WIN32 ReleaseMutex(td.multiLock); #endif |