gint len);
static GMemChunk *array_mem_chunk = NULL;
-G_LOCK_DECLARE_STATIC (array_mem_chunk);
+G_LOCK_DEFINE_STATIC (array_mem_chunk);
GArray*
g_array_new (gboolean zero_terminated,
gint len);
static GMemChunk *ptr_array_mem_chunk = NULL;
-G_LOCK_DECLARE_STATIC (ptr_array_mem_chunk);
+G_LOCK_DEFINE_STATIC (ptr_array_mem_chunk);
GPtrArray*
static GMemChunk *node_mem_chunk = NULL;
-G_LOCK_DECLARE_STATIC (node_mem_chunk);
+G_LOCK_DEFINE_STATIC (node_mem_chunk);
GCache*
g_cache_new (GCacheNewFunc value_new_func,
/* --- variables --- */
-G_LOCK_DECLARE_STATIC (g_dataset_global);
+G_LOCK_DEFINE_STATIC (g_dataset_global);
static GHashTable *g_dataset_location_ht = NULL;
static GDataset *g_dataset_cached = NULL; /* should this be
threadspecific? */
static GData *g_data_cache = NULL;
static guint g_data_cache_length = 0;
-G_LOCK_DECLARE_STATIC (g_quark_global);
+G_LOCK_DEFINE_STATIC (g_quark_global);
static GHashTable *g_quark_ht = NULL;
static gchar **g_quarks = NULL;
static GQuark g_quark_seq_id = 0;
memset (d, 0x0, ndates*sizeof (GDate));
}
-G_LOCK_DECLARE_STATIC (g_date_global);
+G_LOCK_DEFINE_STATIC (g_date_global);
/* These are for the parser, output to the user should use *
* g_date_strftime () - this creates more never-freed memory to annoy
static void g_hash_nodes_destroy (GHashNode *hash_node);
-G_LOCK_DECLARE_STATIC (g_hash_global);
+G_LOCK_DEFINE_STATIC (g_hash_global);
static GMemChunk *node_mem_chunk = NULL;
static GHashNode *node_free_list = NULL;
gpointer data,
GDestroyNotify notify);
-/* these are some convenience macros that expand to nothing if GLib was
- * configured with --deisable-threads. for using StaticMutexes, you
- * declare them with G_LOCK_DECLARE_STATIC (name) or G_LOCK_DECLARE (name)
- * if you need to export the mutex. name is a unique identifier for the
- * protected varibale or code portion. locking, testing and unlocking of
- * such mutexes can be done with G_LOCK(), G_UNLOCK() and G_TRYLOCK()
- * respectively.
+/* these are some convenience macros that expand to nothing if GLib
+ * was configured with --disable-threads. for using StaticMutexes,
+ * you define them with G_LOCK_DEFINE_STATIC (name) or G_LOCK_DEFINE (name)
+ * if you need to export the mutex. With G_LOCK_EXTERN (name) you can
+ * declare such an globally defined lock. name is a unique identifier
+ * for the protected varibale or code portion. locking, testing and
+ * unlocking of such mutexes can be done with G_LOCK(), G_UNLOCK() and
+ * G_TRYLOCK() respectively.
*/
extern void glib_dummy_decl (void);
#define G_LOCK_NAME(name) (g__ ## name ## _lock)
#ifdef G_THREADS_ENABLED
-# define G_LOCK_DECLARE_STATIC(name) static G_LOCK_DECLARE (name)
-# define G_LOCK_DECLARE(name) \
+# define G_LOCK_DEFINE_STATIC(name) static G_LOCK_DEFINE (name)
+# define G_LOCK_DEFINE(name) \
GStaticMutex G_LOCK_NAME (name) = G_STATIC_MUTEX_INIT
+# define G_LOCK_EXTERN(name) extern GStaticMutex G_LOCK_NAME (name)
# ifdef G_DEBUG_LOCKS
# define G_LOCK(name) G_STMT_START{ \
# define G_TRYLOCK(name) g_static_mutex_trylock (G_LOCK_NAME (name))
# endif /* !G_DEBUG_LOCKS */
#else /* !G_THREADS_ENABLED */
-# define G_LOCK_DECLARE_STATIC(name) extern void glib_dummy_decl (void)
-# define G_LOCK_DECLARE(name) extern void glib_dummy_decl (void)
+# define G_LOCK_DEFINE_STATIC(name) extern void glib_dummy_decl (void)
+# define G_LOCK_DEFINE(name) extern void glib_dummy_decl (void)
+# define G_LOCK_EXTERN(name) extern void glib_dummy_decl (void)
# define G_LOCK(name)
# define G_UNLOCK(name)
# define G_TRYLOCK(name) (FALSE)
gint len);
static GMemChunk *array_mem_chunk = NULL;
-G_LOCK_DECLARE_STATIC (array_mem_chunk);
+G_LOCK_DEFINE_STATIC (array_mem_chunk);
GArray*
g_array_new (gboolean zero_terminated,
gint len);
static GMemChunk *ptr_array_mem_chunk = NULL;
-G_LOCK_DECLARE_STATIC (ptr_array_mem_chunk);
+G_LOCK_DEFINE_STATIC (ptr_array_mem_chunk);
GPtrArray*
static GMemChunk *node_mem_chunk = NULL;
-G_LOCK_DECLARE_STATIC (node_mem_chunk);
+G_LOCK_DEFINE_STATIC (node_mem_chunk);
GCache*
g_cache_new (GCacheNewFunc value_new_func,
/* --- variables --- */
-G_LOCK_DECLARE_STATIC (g_dataset_global);
+G_LOCK_DEFINE_STATIC (g_dataset_global);
static GHashTable *g_dataset_location_ht = NULL;
static GDataset *g_dataset_cached = NULL; /* should this be
threadspecific? */
static GData *g_data_cache = NULL;
static guint g_data_cache_length = 0;
-G_LOCK_DECLARE_STATIC (g_quark_global);
+G_LOCK_DEFINE_STATIC (g_quark_global);
static GHashTable *g_quark_ht = NULL;
static gchar **g_quarks = NULL;
static GQuark g_quark_seq_id = 0;
memset (d, 0x0, ndates*sizeof (GDate));
}
-G_LOCK_DECLARE_STATIC (g_date_global);
+G_LOCK_DEFINE_STATIC (g_date_global);
/* These are for the parser, output to the user should use *
* g_date_strftime () - this creates more never-freed memory to annoy
static void g_hash_nodes_destroy (GHashNode *hash_node);
-G_LOCK_DECLARE_STATIC (g_hash_global);
+G_LOCK_DEFINE_STATIC (g_hash_global);
static GMemChunk *node_mem_chunk = NULL;
static GHashNode *node_free_list = NULL;
gpointer data,
GDestroyNotify notify);
-/* these are some convenience macros that expand to nothing if GLib was
- * configured with --deisable-threads. for using StaticMutexes, you
- * declare them with G_LOCK_DECLARE_STATIC (name) or G_LOCK_DECLARE (name)
- * if you need to export the mutex. name is a unique identifier for the
- * protected varibale or code portion. locking, testing and unlocking of
- * such mutexes can be done with G_LOCK(), G_UNLOCK() and G_TRYLOCK()
- * respectively.
+/* these are some convenience macros that expand to nothing if GLib
+ * was configured with --disable-threads. for using StaticMutexes,
+ * you define them with G_LOCK_DEFINE_STATIC (name) or G_LOCK_DEFINE (name)
+ * if you need to export the mutex. With G_LOCK_EXTERN (name) you can
+ * declare such an globally defined lock. name is a unique identifier
+ * for the protected varibale or code portion. locking, testing and
+ * unlocking of such mutexes can be done with G_LOCK(), G_UNLOCK() and
+ * G_TRYLOCK() respectively.
*/
extern void glib_dummy_decl (void);
#define G_LOCK_NAME(name) (g__ ## name ## _lock)
#ifdef G_THREADS_ENABLED
-# define G_LOCK_DECLARE_STATIC(name) static G_LOCK_DECLARE (name)
-# define G_LOCK_DECLARE(name) \
+# define G_LOCK_DEFINE_STATIC(name) static G_LOCK_DEFINE (name)
+# define G_LOCK_DEFINE(name) \
GStaticMutex G_LOCK_NAME (name) = G_STATIC_MUTEX_INIT
+# define G_LOCK_EXTERN(name) extern GStaticMutex G_LOCK_NAME (name)
# ifdef G_DEBUG_LOCKS
# define G_LOCK(name) G_STMT_START{ \
# define G_TRYLOCK(name) g_static_mutex_trylock (G_LOCK_NAME (name))
# endif /* !G_DEBUG_LOCKS */
#else /* !G_THREADS_ENABLED */
-# define G_LOCK_DECLARE_STATIC(name) extern void glib_dummy_decl (void)
-# define G_LOCK_DECLARE(name) extern void glib_dummy_decl (void)
+# define G_LOCK_DEFINE_STATIC(name) extern void glib_dummy_decl (void)
+# define G_LOCK_DEFINE(name) extern void glib_dummy_decl (void)
+# define G_LOCK_EXTERN(name) extern void glib_dummy_decl (void)
# define G_LOCK(name)
# define G_UNLOCK(name)
# define G_TRYLOCK(name) (FALSE)
};
static GAllocator *current_allocator = NULL;
-G_LOCK_DECLARE_STATIC (current_allocator);
+G_LOCK_DEFINE_STATIC (current_allocator);
/* HOLDS: current_allocator_lock */
static void
/* The following lock is used for both the list of sources
* and the list of poll records
*/
-G_LOCK_DECLARE_STATIC (main_loop);
+G_LOCK_DEFINE_STATIC (main_loop);
static GSourceFuncs timeout_funcs =
{
GNode *free_nodes; /* implementation specific */
};
-G_LOCK_DECLARE_STATIC (current_allocator);
+G_LOCK_DEFINE_STATIC (current_allocator);
static GAllocator *current_allocator = NULL;
/* HOLDS: current_allocator_lock */
GSList *free_lists; /* implementation specific */
};
-G_LOCK_DECLARE_STATIC (current_allocator);
+G_LOCK_DEFINE_STATIC (current_allocator);
static GAllocator *current_allocator = NULL;
/* HOLDS: current_allocator_lock */
gint alloc;
};
-G_LOCK_DECLARE_STATIC (string_mem_chunk);
+G_LOCK_DEFINE_STATIC (string_mem_chunk);
static GMemChunk *string_mem_chunk = NULL;
/* Hash Functions.
static void g_tree_node_check (GTreeNode *node);
-G_LOCK_DECLARE_STATIC (g_tree_global);
+G_LOCK_DEFINE_STATIC (g_tree_global);
static GMemChunk *node_mem_chunk = NULL;
static GTreeNode *node_free_list = NULL;
}
-G_LOCK_DECLARE_STATIC (g_utils_global);
+G_LOCK_DEFINE_STATIC (g_utils_global);
static gchar *g_tmp_dir = NULL;
static gchar *g_user_name = NULL;
};
static GAllocator *current_allocator = NULL;
-G_LOCK_DECLARE_STATIC (current_allocator);
+G_LOCK_DEFINE_STATIC (current_allocator);
/* HOLDS: current_allocator_lock */
static void
/* The following lock is used for both the list of sources
* and the list of poll records
*/
-G_LOCK_DECLARE_STATIC (main_loop);
+G_LOCK_DEFINE_STATIC (main_loop);
static GSourceFuncs timeout_funcs =
{
/* --- variables --- */
-G_LOCK_DECLARE_STATIC (GModule);
+G_LOCK_DEFINE_STATIC (GModule);
const char *g_log_domain_gmodule = "GModule";
static GModule *modules = NULL;
static GModule *main_module = NULL;
GNode *free_nodes; /* implementation specific */
};
-G_LOCK_DECLARE_STATIC (current_allocator);
+G_LOCK_DEFINE_STATIC (current_allocator);
static GAllocator *current_allocator = NULL;
/* HOLDS: current_allocator_lock */
GSList *free_lists; /* implementation specific */
};
-G_LOCK_DECLARE_STATIC (current_allocator);
+G_LOCK_DEFINE_STATIC (current_allocator);
static GAllocator *current_allocator = NULL;
/* HOLDS: current_allocator_lock */
gint alloc;
};
-G_LOCK_DECLARE_STATIC (string_mem_chunk);
+G_LOCK_DEFINE_STATIC (string_mem_chunk);
static GMemChunk *string_mem_chunk = NULL;
/* Hash Functions.
GMutex *mutex = NULL;
GCond *cond = NULL;
GStaticMutex static_mutex = G_STATIC_MUTEX_INIT;
- G_LOCK_DECLARE (test_me);
+ G_LOCK_DEFINE (test_me);
if (g_thread_supported ())
{
static void g_tree_node_check (GTreeNode *node);
-G_LOCK_DECLARE_STATIC (g_tree_global);
+G_LOCK_DEFINE_STATIC (g_tree_global);
static GMemChunk *node_mem_chunk = NULL;
static GTreeNode *node_free_list = NULL;
}
-G_LOCK_DECLARE_STATIC (g_utils_global);
+G_LOCK_DEFINE_STATIC (g_utils_global);
static gchar *g_tmp_dir = NULL;
static gchar *g_user_name = NULL;