Support for one-time initialization functions. (#69668, Sebastian
authorMatthias Clasen <maclas@gmx.de>
Tue, 8 Jul 2003 23:43:48 +0000 (23:43 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 8 Jul 2003 23:43:48 +0000 (23:43 +0000)
commit876f9078636e9543a3fec402f13a00dca2af9f41
treea55266e35ca312b47e5cfc8f72a79ae6f36ae3f0
parent238c7c368bf8a33f3d7f9707bec62c823d64a4d9
Support for one-time initialization functions. (#69668, Sebastian

2003-07-09  Matthias Clasen  <maclas@gmx.de>

Support for one-time initialization functions.  (#69668, Sebastian Wilhelmi)

* configure.in: Check whether double checked locking is safe, define g_once() in
glibconfig.h accordingly.
* glib/gthread.h: Add GOnce, GOnceStatus, G_ONCE_INIT and g_once_impl.
* glib/gthread.c (g_once_impl): Fallback implementation using a mutex if double checked
locking is unsafe.
* tests/thread-test.c: Add tests for g_once().
12 files changed:
ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
configure.in
docs/reference/glib/glib-sections.txt
docs/reference/glib/tmpl/threads.sgml
glib/gthread.c
glib/gthread.h
tests/thread-test.c