Use g_atomic_pointer_set instead of old homegrown version now that we have

2006-05-10  Sebastian Wilhelmi  <wilhelmi@google.com>

	* glib/gthread.c: Use g_atomic_pointer_set instead of old
	homegrown version now that we have it. (#335198, Chris Wilson)
This commit is contained in:
Sebastian Wilhelmi 2006-05-11 00:10:29 +00:00 committed by Sebastian Wilhelmi
parent 685da6b099
commit a93560b83d
3 changed files with 71 additions and 74 deletions

View File

@ -1,5 +1,8 @@
2006-05-10 Sebastian Wilhelmi <wilhelmi@google.com>
* glib/gthread.c: Use g_atomic_pointer_set instead of old
homegrown version now that we have it. (#335198, Chris Wilson)
* gthread/gthread-posix.c, gthread/gthread-win32.c: Prevent
calling into g_cond_wait resp. g_mutex_lock/unlock directly to
avoid recursions into the errorcheking mutex code (and out of

View File

@ -1,5 +1,8 @@
2006-05-10 Sebastian Wilhelmi <wilhelmi@google.com>
* glib/gthread.c: Use g_atomic_pointer_set instead of old
homegrown version now that we have it. (#335198, Chris Wilson)
* gthread/gthread-posix.c, gthread/gthread-win32.c: Prevent
calling into g_cond_wait resp. g_mutex_lock/unlock directly to
avoid recursions into the errorcheking mutex code (and out of

View File

@ -203,16 +203,7 @@ g_static_mutex_get_mutex_impl (GMutex** mutex)
g_mutex_lock (g_once_mutex);
if (!(*mutex))
{
GMutex *new_mutex = g_mutex_new ();
/* The following is a memory barrier to avoid the write
* to *new_mutex being reordered to after writing *mutex */
g_mutex_lock (new_mutex);
g_mutex_unlock (new_mutex);
*mutex = new_mutex;
}
g_atomic_pointer_set (mutex, g_mutex_new());
g_mutex_unlock (g_once_mutex);