Use another LOCK for g_prgname to avoid deadlocking. (#62606)

2001-10-19  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* glib/gutils.c (g_set_prgname, g_get_prgname): Use another LOCK
	for g_prgname to avoid deadlocking. (#62606)
This commit is contained in:
Sebastian Wilhelmi 2001-10-19 08:09:22 +00:00 committed by Sebastian Wilhelmi
parent 73c99a0f64
commit 144cb923dd
9 changed files with 46 additions and 8 deletions

View File

@ -1,3 +1,8 @@
2001-10-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib/gutils.c (g_set_prgname, g_get_prgname): Use another LOCK
for g_prgname to avoid deadlocking. (#62606)
2001-10-19 Tor Lillqvist <tml@iki.fi>
* configure.in: Check also ac_cv_sizeof___int64 when requiring a

View File

@ -1,3 +1,8 @@
2001-10-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib/gutils.c (g_set_prgname, g_get_prgname): Use another LOCK
for g_prgname to avoid deadlocking. (#62606)
2001-10-19 Tor Lillqvist <tml@iki.fi>
* configure.in: Check also ac_cv_sizeof___int64 when requiring a

View File

@ -1,3 +1,8 @@
2001-10-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib/gutils.c (g_set_prgname, g_get_prgname): Use another LOCK
for g_prgname to avoid deadlocking. (#62606)
2001-10-19 Tor Lillqvist <tml@iki.fi>
* configure.in: Check also ac_cv_sizeof___int64 when requiring a

View File

@ -1,3 +1,8 @@
2001-10-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib/gutils.c (g_set_prgname, g_get_prgname): Use another LOCK
for g_prgname to avoid deadlocking. (#62606)
2001-10-19 Tor Lillqvist <tml@iki.fi>
* configure.in: Check also ac_cv_sizeof___int64 when requiring a

View File

@ -1,3 +1,8 @@
2001-10-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib/gutils.c (g_set_prgname, g_get_prgname): Use another LOCK
for g_prgname to avoid deadlocking. (#62606)
2001-10-19 Tor Lillqvist <tml@iki.fi>
* configure.in: Check also ac_cv_sizeof___int64 when requiring a

View File

@ -1,3 +1,8 @@
2001-10-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib/gutils.c (g_set_prgname, g_get_prgname): Use another LOCK
for g_prgname to avoid deadlocking. (#62606)
2001-10-19 Tor Lillqvist <tml@iki.fi>
* configure.in: Check also ac_cv_sizeof___int64 when requiring a

View File

@ -1,3 +1,8 @@
2001-10-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib/gutils.c (g_set_prgname, g_get_prgname): Use another LOCK
for g_prgname to avoid deadlocking. (#62606)
2001-10-19 Tor Lillqvist <tml@iki.fi>
* configure.in: Check also ac_cv_sizeof___int64 when requiring a

View File

@ -1,3 +1,8 @@
2001-10-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib/gutils.c (g_set_prgname, g_get_prgname): Use another LOCK
for g_prgname to avoid deadlocking. (#62606)
2001-10-19 Tor Lillqvist <tml@iki.fi>
* configure.in: Check also ac_cv_sizeof___int64 when requiring a

View File

@ -1000,6 +1000,7 @@ g_get_tmp_dir (void)
return g_tmp_dir;
}
G_LOCK_DEFINE (g_prgname);
static gchar *g_prgname = NULL;
gchar*
@ -1007,9 +1008,9 @@ g_get_prgname (void)
{
gchar* retval;
G_LOCK (g_utils_global);
G_LOCK (g_prgname);
retval = g_prgname;
G_UNLOCK (g_utils_global);
G_UNLOCK (g_prgname);
return retval;
}
@ -1017,13 +1018,10 @@ g_get_prgname (void)
void
g_set_prgname (const gchar *prgname)
{
gchar *c;
G_LOCK (g_utils_global);
c = g_prgname;
G_LOCK (g_prgname);
g_free (g_prgname);
g_prgname = g_strdup (prgname);
g_free (c);
G_UNLOCK (g_utils_global);
G_UNLOCK (g_prgname);
}
guint