2001-01-09 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gmem.c: Made g_profile_mutex a GMutex* instead of
G_LOCK_DEFINE_STATIC to avoid deadlock for thread implementations
without native static mutexes. Contruct g_profile_mutex in
g_mem_init().
+2001-01-09 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
+
+ * gmem.c: Made g_profile_mutex a GMutex* instead of
+ G_LOCK_DEFINE_STATIC to avoid deadlock for thread implementations
+ without native static mutexes. Contruct g_profile_mutex in
+ g_mem_init().
+
2001-01-06 Tor Lillqvist <tml@iki.fi>
* gconvert.c (g_locale_to_utf8, g_locale_from_utf8): Get len using
2001-01-06 Tor Lillqvist <tml@iki.fi>
* gconvert.c (g_locale_to_utf8, g_locale_from_utf8): Get len using
+2001-01-09 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
+
+ * gmem.c: Made g_profile_mutex a GMutex* instead of
+ G_LOCK_DEFINE_STATIC to avoid deadlock for thread implementations
+ without native static mutexes. Contruct g_profile_mutex in
+ g_mem_init().
+
2001-01-06 Tor Lillqvist <tml@iki.fi>
* gconvert.c (g_locale_to_utf8, g_locale_from_utf8): Get len using
2001-01-06 Tor Lillqvist <tml@iki.fi>
* gconvert.c (g_locale_to_utf8, g_locale_from_utf8): Get len using
+2001-01-09 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
+
+ * gmem.c: Made g_profile_mutex a GMutex* instead of
+ G_LOCK_DEFINE_STATIC to avoid deadlock for thread implementations
+ without native static mutexes. Contruct g_profile_mutex in
+ g_mem_init().
+
2001-01-06 Tor Lillqvist <tml@iki.fi>
* gconvert.c (g_locale_to_utf8, g_locale_from_utf8): Get len using
2001-01-06 Tor Lillqvist <tml@iki.fi>
* gconvert.c (g_locale_to_utf8, g_locale_from_utf8): Get len using
+2001-01-09 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
+
+ * gmem.c: Made g_profile_mutex a GMutex* instead of
+ G_LOCK_DEFINE_STATIC to avoid deadlock for thread implementations
+ without native static mutexes. Contruct g_profile_mutex in
+ g_mem_init().
+
2001-01-06 Tor Lillqvist <tml@iki.fi>
* gconvert.c (g_locale_to_utf8, g_locale_from_utf8): Get len using
2001-01-06 Tor Lillqvist <tml@iki.fi>
* gconvert.c (g_locale_to_utf8, g_locale_from_utf8): Get len using
+2001-01-09 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
+
+ * gmem.c: Made g_profile_mutex a GMutex* instead of
+ G_LOCK_DEFINE_STATIC to avoid deadlock for thread implementations
+ without native static mutexes. Contruct g_profile_mutex in
+ g_mem_init().
+
2001-01-06 Tor Lillqvist <tml@iki.fi>
* gconvert.c (g_locale_to_utf8, g_locale_from_utf8): Get len using
2001-01-06 Tor Lillqvist <tml@iki.fi>
* gconvert.c (g_locale_to_utf8, g_locale_from_utf8): Get len using
+2001-01-09 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
+
+ * gmem.c: Made g_profile_mutex a GMutex* instead of
+ G_LOCK_DEFINE_STATIC to avoid deadlock for thread implementations
+ without native static mutexes. Contruct g_profile_mutex in
+ g_mem_init().
+
2001-01-06 Tor Lillqvist <tml@iki.fi>
* gconvert.c (g_locale_to_utf8, g_locale_from_utf8): Get len using
2001-01-06 Tor Lillqvist <tml@iki.fi>
* gconvert.c (g_locale_to_utf8, g_locale_from_utf8): Get len using
+2001-01-09 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
+
+ * gmem.c: Made g_profile_mutex a GMutex* instead of
+ G_LOCK_DEFINE_STATIC to avoid deadlock for thread implementations
+ without native static mutexes. Contruct g_profile_mutex in
+ g_mem_init().
+
2001-01-06 Tor Lillqvist <tml@iki.fi>
* gconvert.c (g_locale_to_utf8, g_locale_from_utf8): Get len using
2001-01-06 Tor Lillqvist <tml@iki.fi>
* gconvert.c (g_locale_to_utf8, g_locale_from_utf8): Get len using
+2001-01-09 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
+
+ * gmem.c: Made g_profile_mutex a GMutex* instead of
+ G_LOCK_DEFINE_STATIC to avoid deadlock for thread implementations
+ without native static mutexes. Contruct g_profile_mutex in
+ g_mem_init().
+
2001-01-06 Tor Lillqvist <tml@iki.fi>
* gconvert.c (g_locale_to_utf8, g_locale_from_utf8): Get len using
2001-01-06 Tor Lillqvist <tml@iki.fi>
* gconvert.c (g_locale_to_utf8, g_locale_from_utf8): Get len using
static gulong profile_zinit = 0;
static gulong profile_frees = 0;
static gulong profile_mc_frees = 0;
static gulong profile_zinit = 0;
static gulong profile_frees = 0;
static gulong profile_mc_frees = 0;
-G_LOCK_DEFINE_STATIC (g_profile_mutex);
+static GMutex *g_profile_mutex = NULL;
#ifdef G_ENABLE_DEBUG
static volatile gulong glib_trap_free_size = 0;
static volatile gulong glib_trap_realloc_size = 0;
#ifdef G_ENABLE_DEBUG
static volatile gulong glib_trap_free_size = 0;
static volatile gulong glib_trap_realloc_size = 0;
gulong n_bytes,
gboolean success)
{
gulong n_bytes,
gboolean success)
{
- G_LOCK (g_profile_mutex);
+ g_mutex_lock (g_profile_mutex);
if (!profile_data)
{
profile_data = standard_malloc ((MEM_PROFILE_TABLE_SIZE + 1) * 8 * sizeof (profile_data[0]));
if (!profile_data) /* memory system kiddin' me, eh? */
{
if (!profile_data)
{
profile_data = standard_malloc ((MEM_PROFILE_TABLE_SIZE + 1) * 8 * sizeof (profile_data[0]));
if (!profile_data) /* memory system kiddin' me, eh? */
{
- G_UNLOCK (g_profile_mutex);
+ g_mutex_unlock (g_profile_mutex);
else
profile_mc_frees += n_bytes;
}
else
profile_mc_frees += n_bytes;
}
- G_UNLOCK (g_profile_mutex);
+ g_mutex_unlock (g_profile_mutex);
gulong local_mc_allocs = profile_mc_allocs;
gulong local_mc_frees = profile_mc_frees;
gulong local_mc_allocs = profile_mc_allocs;
gulong local_mc_frees = profile_mc_frees;
- G_LOCK (g_profile_mutex);
+ g_mutex_lock (g_profile_mutex);
- G_UNLOCK (g_profile_mutex);
+ g_mutex_unlock (g_profile_mutex);
local_mc_frees,
((gdouble) local_mc_frees) / local_mc_allocs * 100.0,
local_mc_allocs - local_mc_frees);
local_mc_frees,
((gdouble) local_mc_frees) / local_mc_allocs * 100.0,
local_mc_allocs - local_mc_frees);
- G_UNLOCK (g_profile_mutex);
+ g_mutex_unlock (g_profile_mutex);
#endif
#ifndef G_DISABLE_CHECKS
mem_chunk_recursion = g_private_new (NULL);
#endif
#ifndef G_DISABLE_CHECKS
mem_chunk_recursion = g_private_new (NULL);
+ g_profile_mutex = g_mutex_new ();
static gulong profile_zinit = 0;
static gulong profile_frees = 0;
static gulong profile_mc_frees = 0;
static gulong profile_zinit = 0;
static gulong profile_frees = 0;
static gulong profile_mc_frees = 0;
-G_LOCK_DEFINE_STATIC (g_profile_mutex);
+static GMutex *g_profile_mutex = NULL;
#ifdef G_ENABLE_DEBUG
static volatile gulong glib_trap_free_size = 0;
static volatile gulong glib_trap_realloc_size = 0;
#ifdef G_ENABLE_DEBUG
static volatile gulong glib_trap_free_size = 0;
static volatile gulong glib_trap_realloc_size = 0;
gulong n_bytes,
gboolean success)
{
gulong n_bytes,
gboolean success)
{
- G_LOCK (g_profile_mutex);
+ g_mutex_lock (g_profile_mutex);
if (!profile_data)
{
profile_data = standard_malloc ((MEM_PROFILE_TABLE_SIZE + 1) * 8 * sizeof (profile_data[0]));
if (!profile_data) /* memory system kiddin' me, eh? */
{
if (!profile_data)
{
profile_data = standard_malloc ((MEM_PROFILE_TABLE_SIZE + 1) * 8 * sizeof (profile_data[0]));
if (!profile_data) /* memory system kiddin' me, eh? */
{
- G_UNLOCK (g_profile_mutex);
+ g_mutex_unlock (g_profile_mutex);
else
profile_mc_frees += n_bytes;
}
else
profile_mc_frees += n_bytes;
}
- G_UNLOCK (g_profile_mutex);
+ g_mutex_unlock (g_profile_mutex);
gulong local_mc_allocs = profile_mc_allocs;
gulong local_mc_frees = profile_mc_frees;
gulong local_mc_allocs = profile_mc_allocs;
gulong local_mc_frees = profile_mc_frees;
- G_LOCK (g_profile_mutex);
+ g_mutex_lock (g_profile_mutex);
- G_UNLOCK (g_profile_mutex);
+ g_mutex_unlock (g_profile_mutex);
local_mc_frees,
((gdouble) local_mc_frees) / local_mc_allocs * 100.0,
local_mc_allocs - local_mc_frees);
local_mc_frees,
((gdouble) local_mc_frees) / local_mc_allocs * 100.0,
local_mc_allocs - local_mc_frees);
- G_UNLOCK (g_profile_mutex);
+ g_mutex_unlock (g_profile_mutex);
#endif
#ifndef G_DISABLE_CHECKS
mem_chunk_recursion = g_private_new (NULL);
#endif
#ifndef G_DISABLE_CHECKS
mem_chunk_recursion = g_private_new (NULL);
+ g_profile_mutex = g_mutex_new ();