diff options
author | Dan Winship <danw@src.gnome.org> | 2008-02-01 18:15:18 +0000 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2008-02-01 18:15:18 +0000 |
commit | 87dff5a5be45fd038f2ec4e0b19599ef734ef5e2 (patch) | |
tree | 98a199880d276932f11b3a7d3233c8207c822196 /libsoup/soup-date.c | |
parent | ec7a14f0bc576b77d3791609a576f76c23a7604c (diff) | |
download | libsoup-87dff5a5be45fd038f2ec4e0b19599ef734ef5e2.tar.gz |
Use GObject properties. (soup_address_new, soup_address_new_from_sockaddr)
* libsoup/soup-address.c: Use GObject properties.
(soup_address_new, soup_address_new_from_sockaddr)
(soup_address_new_any): Make these just wrappers around
g_object_new.
* libsoup/soup-message-body.c (soup_message_body_get_type):
* libsoup/soup-message-headers.c (soup_message_headers_get_type):
* libsoup/soup-server.c (soup_client_context_get_type):
Register these as boxed types, for language bindings.
* libsoup/soup-date.c (soup_date_get_type):
* libsoup/soup-message-body.c (soup_buffer_get_type):
* libsoup/soup-value-utils.c (soup_byte_array_get_type):
* libsoup/soup-uri.c (soup_uri_get_type): Upgrade to the latest
yummiest type-registering idiom.
svn path=/trunk/; revision=1067
Diffstat (limited to 'libsoup/soup-date.c')
-rw-r--r-- | libsoup/soup-date.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/libsoup/soup-date.c b/libsoup/soup-date.c index 02a26ec6..52fcbd4f 100644 --- a/libsoup/soup-date.c +++ b/libsoup/soup-date.c @@ -54,15 +54,16 @@ static const int days_before[] = { GType soup_date_get_type (void) { - static GType type = 0; + static volatile gsize type_volatile = 0; - if (type == 0) { - type = g_boxed_type_register_static ( + if (g_once_init_enter (&type_volatile)) { + GType type = g_boxed_type_register_static ( g_intern_static_string ("SoupDate"), - (GBoxedCopyFunc)soup_date_copy, - (GBoxedFreeFunc)soup_date_free); + (GBoxedCopyFunc) soup_date_copy, + (GBoxedFreeFunc) soup_date_free); + g_once_init_leave (&type_volatile, type); } - return type; + return type_volatile; } /** |