mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 23:13:40 +02:00
version bump to 1.1.8, binary age 0, interface age 0.
Wed Dec 16 03:16:58 1998 Tim Janik <timj@gtk.org> * configure.in: version bump to 1.1.8, binary age 0, interface age 0. * glib.h: changed g_lock() to G_LOCK(), g_unlock() to G_UNLOCK() and g_trylock() to G_TRYLOCK(), since these are macros that expand to nothing with --disable-threads. changed G_LOCK_DEFINE() to G_LOCK_DECLARE() and introduced G_LOCK_DECLARE_STATIC() to achive the results of static G_LOCK_DECLARE(). changed semantics of g_thread_supported to g_thread_supported() so it can be used as a function like g_module_supported(). the actuall definition is still a macro that expands into a variable for performance reasons though. various indentation and coding style cleanups. * configure.in: added --enable-threads that defaults to yes. * gmutex.c: changed tests g_thread_supported to g_thread_supported (), changed variable settings of g_thread_supported to g_threads_got_initialized. garray.c: gcache.c: gdataset.c: gdate.c: ghash.c: glist.c: gmain.c: gnode.c: gslist.c: gstring.c: gtree.c: gutils.c: changed s/g_lock/G_LOCK/, s/g_unlock/G_UNLOCK/, s/static G_LOCK_DEFINE/G_LOCK_DECLARE_STATIC/.
This commit is contained in:
22
glist.c
22
glist.c
@@ -36,7 +36,7 @@ struct _GAllocator /* from gmem.c */
|
||||
};
|
||||
|
||||
static GAllocator *current_allocator = NULL;
|
||||
static G_LOCK_DEFINE(current_allocator);
|
||||
G_LOCK_DECLARE_STATIC (current_allocator);
|
||||
|
||||
/* HOLDS: current_allocator_lock */
|
||||
static void
|
||||
@@ -70,17 +70,17 @@ g_list_validate_allocator (GAllocator *allocator)
|
||||
void
|
||||
g_list_push_allocator(GAllocator *allocator)
|
||||
{
|
||||
g_lock (current_allocator);
|
||||
G_LOCK (current_allocator);
|
||||
g_list_validate_allocator ( allocator );
|
||||
allocator->last = current_allocator;
|
||||
current_allocator = allocator;
|
||||
g_unlock (current_allocator);
|
||||
G_UNLOCK (current_allocator);
|
||||
}
|
||||
|
||||
void
|
||||
g_list_pop_allocator (void)
|
||||
{
|
||||
g_lock (current_allocator);
|
||||
G_LOCK (current_allocator);
|
||||
if (current_allocator)
|
||||
{
|
||||
GAllocator *allocator;
|
||||
@@ -90,7 +90,7 @@ g_list_pop_allocator (void)
|
||||
allocator->last = NULL;
|
||||
allocator->is_unused = TRUE;
|
||||
}
|
||||
g_unlock (current_allocator);
|
||||
G_UNLOCK (current_allocator);
|
||||
}
|
||||
|
||||
GList*
|
||||
@@ -98,7 +98,7 @@ g_list_alloc (void)
|
||||
{
|
||||
GList *list;
|
||||
|
||||
g_lock (current_allocator);
|
||||
G_LOCK (current_allocator);
|
||||
if (!current_allocator)
|
||||
{
|
||||
GAllocator *allocator = g_allocator_new ("GLib default GList allocator",
|
||||
@@ -126,7 +126,7 @@ g_list_alloc (void)
|
||||
current_allocator->free_lists = list->next;
|
||||
}
|
||||
}
|
||||
g_unlock (current_allocator);
|
||||
G_UNLOCK (current_allocator);
|
||||
list->next = NULL;
|
||||
list->prev = NULL;
|
||||
|
||||
@@ -139,10 +139,10 @@ g_list_free (GList *list)
|
||||
if (list)
|
||||
{
|
||||
list->data = list->next;
|
||||
g_lock (current_allocator);
|
||||
G_LOCK (current_allocator);
|
||||
list->next = current_allocator->free_lists;
|
||||
current_allocator->free_lists = list;
|
||||
g_unlock (current_allocator);
|
||||
G_UNLOCK (current_allocator);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,10 +152,10 @@ g_list_free_1 (GList *list)
|
||||
if (list)
|
||||
{
|
||||
list->data = NULL;
|
||||
g_lock (current_allocator);
|
||||
G_LOCK (current_allocator);
|
||||
list->next = current_allocator->free_lists;
|
||||
current_allocator->free_lists = list;
|
||||
g_unlock (current_allocator);
|
||||
G_UNLOCK (current_allocator);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user