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:
Tim Janik
1998-12-16 05:38:35 +00:00
committed by Tim Janik
parent 06600bd0e6
commit b2e318ff3e
42 changed files with 1223 additions and 941 deletions

18
gnode.c
View File

@@ -39,7 +39,7 @@ struct _GAllocator /* from gmem.c */
GNode *free_nodes; /* implementation specific */
};
static G_LOCK_DEFINE(current_allocator);
G_LOCK_DECLARE_STATIC (current_allocator);
static GAllocator *current_allocator = NULL;
/* HOLDS: current_allocator_lock */
@@ -74,17 +74,17 @@ g_node_validate_allocator (GAllocator *allocator)
void
g_node_push_allocator (GAllocator *allocator)
{
g_lock (current_allocator);
G_LOCK (current_allocator);
g_node_validate_allocator ( allocator );
allocator->last = current_allocator;
current_allocator = allocator;
g_unlock (current_allocator);
G_UNLOCK (current_allocator);
}
void
g_node_pop_allocator (void)
{
g_lock (current_allocator);
G_LOCK (current_allocator);
if (current_allocator)
{
GAllocator *allocator;
@@ -94,7 +94,7 @@ g_node_pop_allocator (void)
allocator->last = NULL;
allocator->is_unused = TRUE;
}
g_unlock (current_allocator);
G_UNLOCK (current_allocator);
}
@@ -104,7 +104,7 @@ g_node_new (gpointer data)
{
GNode *node;
g_lock (current_allocator);
G_LOCK (current_allocator);
if (!current_allocator)
{
GAllocator *allocator = g_allocator_new ("GLib default GNode allocator",
@@ -120,7 +120,7 @@ g_node_new (gpointer data)
node = current_allocator->free_nodes;
current_allocator->free_nodes = node->next;
}
g_unlock (current_allocator);
G_UNLOCK (current_allocator);
node->data = data;
node->next = NULL;
@@ -147,10 +147,10 @@ g_nodes_free (GNode *node)
break;
}
g_lock (current_allocator);
G_LOCK (current_allocator);
parent->next = current_allocator->free_nodes;
current_allocator->free_nodes = node;
g_unlock (current_allocator);
G_UNLOCK (current_allocator);
}
void