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

View File

@@ -67,7 +67,7 @@ static inline GQuark g_quark_new (gchar *string);
/* --- variables --- */
static G_LOCK_DEFINE(g_dataset_global);
G_LOCK_DECLARE_STATIC (g_dataset_global);
static GHashTable *g_dataset_location_ht = NULL;
static GDataset *g_dataset_cached = NULL; /* should this be
threadspecific? */
@@ -76,7 +76,7 @@ static GMemChunk *g_data_mem_chunk = NULL;
static GData *g_data_cache = NULL;
static guint g_data_cache_length = 0;
static G_LOCK_DEFINE(g_quark_global);
G_LOCK_DECLARE_STATIC (g_quark_global);
static GHashTable *g_quark_ht = NULL;
static gchar **g_quarks = NULL;
static GQuark g_quark_seq_id = 0;
@@ -121,13 +121,13 @@ g_datalist_clear (GData **datalist)
{
g_return_if_fail (datalist != NULL);
g_lock (g_dataset_global);
G_LOCK (g_dataset_global);
if (!g_dataset_location_ht)
g_data_initialize ();
while (*datalist)
g_datalist_clear_i (datalist);
g_unlock (g_dataset_global);
G_UNLOCK (g_dataset_global);
}
/* HOLDS: g_dataset_global_lock */
@@ -174,7 +174,7 @@ g_dataset_destroy (gconstpointer dataset_location)
{
g_return_if_fail (dataset_location != NULL);
g_lock (g_dataset_global);
G_LOCK (g_dataset_global);
if (g_dataset_location_ht)
{
register GDataset *dataset;
@@ -183,7 +183,7 @@ g_dataset_destroy (gconstpointer dataset_location)
if (dataset)
g_dataset_destroy_internal (dataset);
}
g_unlock (g_dataset_global);
G_UNLOCK (g_dataset_global);
}
/* HOLDS: g_dataset_global_lock */
@@ -312,7 +312,7 @@ g_dataset_id_set_data_full (gconstpointer dataset_location,
return;
}
g_lock (g_dataset_global);
G_LOCK (g_dataset_global);
if (!g_dataset_location_ht)
g_data_initialize ();
@@ -328,7 +328,7 @@ g_dataset_id_set_data_full (gconstpointer dataset_location,
}
g_data_set_internal (&dataset->datalist, key_id, data, destroy_func, dataset);
g_unlock (g_dataset_global);
G_UNLOCK (g_dataset_global);
}
void
@@ -348,12 +348,12 @@ g_datalist_id_set_data_full (GData **datalist,
return;
}
g_lock (g_dataset_global);
G_LOCK (g_dataset_global);
if (!g_dataset_location_ht)
g_data_initialize ();
g_data_set_internal (datalist, key_id, data, destroy_func, NULL);
g_unlock (g_dataset_global);
G_UNLOCK (g_dataset_global);
}
void
@@ -362,7 +362,7 @@ g_dataset_id_remove_no_notify (gconstpointer dataset_location,
{
g_return_if_fail (dataset_location != NULL);
g_lock (g_dataset_global);
G_LOCK (g_dataset_global);
if (key_id && g_dataset_location_ht)
{
GDataset *dataset;
@@ -371,7 +371,7 @@ g_dataset_id_remove_no_notify (gconstpointer dataset_location,
if (dataset)
g_data_set_internal (&dataset->datalist, key_id, NULL, (GDestroyNotify) 42, dataset);
}
g_unlock (g_dataset_global);
G_UNLOCK (g_dataset_global);
}
void
@@ -380,10 +380,10 @@ g_datalist_id_remove_no_notify (GData **datalist,
{
g_return_if_fail (datalist != NULL);
g_lock (g_dataset_global);
G_LOCK (g_dataset_global);
if (key_id && g_dataset_location_ht)
g_data_set_internal (datalist, key_id, NULL, (GDestroyNotify) 42, NULL);
g_unlock (g_dataset_global);
G_UNLOCK (g_dataset_global);
}
gpointer
@@ -392,7 +392,7 @@ g_dataset_id_get_data (gconstpointer dataset_location,
{
g_return_val_if_fail (dataset_location != NULL, NULL);
g_lock (g_dataset_global);
G_LOCK (g_dataset_global);
if (key_id && g_dataset_location_ht)
{
register GDataset *dataset;
@@ -405,12 +405,12 @@ g_dataset_id_get_data (gconstpointer dataset_location,
for (list = dataset->datalist; list; list = list->next)
if (list->id == key_id)
{
g_unlock (g_dataset_global);
G_UNLOCK (g_dataset_global);
return list->data;
}
}
}
g_unlock (g_dataset_global);
G_UNLOCK (g_dataset_global);
return NULL;
}
@@ -443,11 +443,11 @@ g_dataset_foreach (gconstpointer dataset_location,
g_return_if_fail (dataset_location != NULL);
g_return_if_fail (func != NULL);
g_lock (g_dataset_global);
G_LOCK (g_dataset_global);
if (g_dataset_location_ht)
{
dataset = g_dataset_lookup (dataset_location);
g_unlock (g_dataset_global);
G_UNLOCK (g_dataset_global);
if (dataset)
{
register GData *list;
@@ -458,7 +458,7 @@ g_dataset_foreach (gconstpointer dataset_location,
}
else
{
g_unlock (g_dataset_global);
G_UNLOCK (g_dataset_global);
}
}
@@ -510,10 +510,10 @@ g_quark_try_string (const gchar *string)
GQuark quark = 0;
g_return_val_if_fail (string != NULL, 0);
g_lock (g_quark_global);
G_LOCK (g_quark_global);
if (g_quark_ht)
quark = GPOINTER_TO_UINT (g_hash_table_lookup (g_quark_ht, string));
g_unlock (g_quark_global);
G_UNLOCK (g_quark_global);
return quark;
}
@@ -525,7 +525,7 @@ g_quark_from_string (const gchar *string)
g_return_val_if_fail (string != NULL, 0);
g_lock (g_quark_global);
G_LOCK (g_quark_global);
if (g_quark_ht)
quark = (gulong) g_hash_table_lookup (g_quark_ht, string);
else
@@ -536,7 +536,7 @@ g_quark_from_string (const gchar *string)
if (!quark)
quark = g_quark_new (g_strdup (string));
g_unlock (g_quark_global);
G_UNLOCK (g_quark_global);
return quark;
}
@@ -548,7 +548,7 @@ g_quark_from_static_string (const gchar *string)
g_return_val_if_fail (string != NULL, 0);
g_lock (g_quark_global);
G_LOCK (g_quark_global);
if (g_quark_ht)
quark = (gulong) g_hash_table_lookup (g_quark_ht, string);
else
@@ -559,7 +559,7 @@ g_quark_from_static_string (const gchar *string)
if (!quark)
quark = g_quark_new ((gchar*) string);
g_unlock (g_quark_global);
G_UNLOCK (g_quark_global);
return quark;
}
@@ -568,10 +568,10 @@ gchar*
g_quark_to_string (GQuark quark)
{
gchar* result = NULL;
g_lock (g_quark_global);
G_LOCK (g_quark_global);
if (quark > 0 && quark <= g_quark_seq_id)
result = g_quarks[quark - 1];
g_unlock (g_quark_global);
G_UNLOCK (g_quark_global);
return result;
}