mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
more atomic ops pointer cast fixes. this time it'll work with atomic op
Fri Jul 13 01:01:46 2007 Tim Janik <timj@imendio.com> * glib/gthread.[hc]: more atomic ops pointer cast fixes. this time it'll work with atomic op macros *and* atomic op functions. svn path=/trunk/; revision=5638
This commit is contained in:
parent
b1e888b60e
commit
95e5ffb695
@ -1,3 +1,8 @@
|
|||||||
|
Fri Jul 13 01:01:46 2007 Tim Janik <timj@imendio.com>
|
||||||
|
|
||||||
|
* glib/gthread.[hc]: more atomic ops pointer cast fixes. this time it'll
|
||||||
|
work with atomic op macros *and* atomic op functions.
|
||||||
|
|
||||||
Fri Jul 13 00:50:40 2007 Tim Janik <timj@imendio.com>
|
Fri Jul 13 00:50:40 2007 Tim Janik <timj@imendio.com>
|
||||||
|
|
||||||
* glib/gthread.[hc]: fixed missing pointer casts when using atomic ops.
|
* glib/gthread.[hc]: fixed missing pointer casts when using atomic ops.
|
||||||
|
@ -223,11 +223,11 @@ void
|
|||||||
g_once_init_leave (volatile gsize *value_location,
|
g_once_init_leave (volatile gsize *value_location,
|
||||||
gsize initialization_value)
|
gsize initialization_value)
|
||||||
{
|
{
|
||||||
g_return_if_fail (g_atomic_pointer_get ((void*) value_location) == 0);
|
g_return_if_fail (g_atomic_pointer_get ((void**) value_location) == 0);
|
||||||
g_return_if_fail (initialization_value != 0);
|
g_return_if_fail (initialization_value != 0);
|
||||||
g_return_if_fail (g_once_init_list != NULL);
|
g_return_if_fail (g_once_init_list != NULL);
|
||||||
|
|
||||||
g_atomic_pointer_set ((void*) value_location, (void*) initialization_value);
|
g_atomic_pointer_set ((void**) value_location, (void*) initialization_value);
|
||||||
g_mutex_lock (g_once_mutex);
|
g_mutex_lock (g_once_mutex);
|
||||||
g_once_init_list = g_slist_remove (g_once_init_list, (void*) value_location);
|
g_once_init_list = g_slist_remove (g_once_init_list, (void*) value_location);
|
||||||
g_cond_broadcast (g_once_cond);
|
g_cond_broadcast (g_once_cond);
|
||||||
@ -255,7 +255,7 @@ g_static_mutex_get_mutex_impl (GMutex** mutex)
|
|||||||
g_mutex_lock (g_once_mutex);
|
g_mutex_lock (g_once_mutex);
|
||||||
|
|
||||||
if (!(*mutex))
|
if (!(*mutex))
|
||||||
g_atomic_pointer_set ((void*) mutex, g_mutex_new());
|
g_atomic_pointer_set ((void**) mutex, g_mutex_new());
|
||||||
|
|
||||||
g_mutex_unlock (g_once_mutex);
|
g_mutex_unlock (g_once_mutex);
|
||||||
|
|
||||||
|
@ -332,7 +332,7 @@ void g_once_init_leave (volatile gsize *value_location,
|
|||||||
G_INLINE_FUNC gboolean
|
G_INLINE_FUNC gboolean
|
||||||
g_once_init_enter (volatile gsize *value_location)
|
g_once_init_enter (volatile gsize *value_location)
|
||||||
{
|
{
|
||||||
if G_LIKELY (g_atomic_pointer_get ((void*) value_location) !=0)
|
if G_LIKELY (g_atomic_pointer_get ((void**) value_location) !=0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
else
|
else
|
||||||
return g_once_init_enter_impl (value_location);
|
return g_once_init_enter_impl (value_location);
|
||||||
|
Loading…
Reference in New Issue
Block a user