is supposed to work without threads.
svn path=/trunk/; revision=6943
+2008-05-27 Matthias Clasen <mclasen@redhat.com>
+
+ * Revert the patch for bug 527214 and related changes. GTimer
+ is supposed to work without threads.
+
2008-05-27 simon.zheng <simon.zheng@sun.com>
* configure.in: Fix #533369. Check whether memeber statvfs.f_basetype
will only have to call <literal>g_thread_init (NULL)</literal>.
</para>
-<note>
-<para>
+<note><para>
Do not call g_thread_init() with a non-%NULL parameter unless you
really know what you are doing.
-</para>
-</note>
+</para></note>
-<note>
-<para>
+<note><para>
g_thread_init() must not be called directly or indirectly as a
callback from GLib. Also no mutexes may be currently locked while
calling g_thread_init().
-</para>
-</note>
+</para></note>
+
+<note><para>
+g_thread_init() changes the way in which #GTimer measures elapsed time.
+As a consequence, timers that are running while g_thread_init() is called
+may report unreliable times.
+</para></note>
<para>
g_thread_init() might only be called once. On the second call
get exactly right, so #GTimer provides a portable/convenient interface.
</para>
<note><para>
-#GTimer internally uses the threading API. Therefore g_thread_init() has to be
-called before creating #GTimer instances.
+#GTimer uses a higher-quality clock when thread support is available.
+Therefore, calling g_thread_init() while timers are running may lead to
+unreliable results. It is best to call g_thread_init() before starting
+any timers, if you are using threads at all.
</para></note>
<!-- ##### SECTION See_Also ##### -->
Creates a new timer, and starts timing (i.e. g_timer_start() is implicitly
called for you).
</para>
-<note><para>
-Call g_thread_init() before using this function.
-</para></note>
@Returns: a new #GTimer.
noinst_PROGRAMS = $(TEST_PROGS)
progs_ldadd = \
$(top_builddir)/glib/libglib-2.0.la \
- $(top_builddir)/gthread/libgthread-2.0.la \
$(top_builddir)/gobject/libgobject-2.0.la \
$(top_builddir)/gio/libgio-2.0.la
char *argv[])
{
g_type_init ();
- g_thread_init (0);
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/data-input-stream/read-lines-LF", test_read_lines_LF);
char *argv[])
{
g_type_init ();
- g_thread_init (0);
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/data-input-stream/read-lines-LF", test_read_lines_LF);
char *argv[])
{
g_type_init ();
- g_thread_init (0);
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/g-file-info/test_g_file_info", test_g_file_info);
char *argv[])
{
g_type_init ();
- g_thread_init (0);
g_test_init (&argc, &argv, NULL);
/* strip all gtester-specific args */
g_type_init ();
- g_thread_init (0);
g_test_init (&argc, &argv, NULL);
/* no extra parameters specified, assume we're executed from glib test suite */
char *argv[])
{
g_type_init ();
- g_thread_init (0);
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/memory-input-stream/read-chunks", test_read_chunks);
INSTALL_PROGS += gtester
gtester_SOURCES = gtester.c
-gtester_LDADD = libglib-2.0.la
+gtester_LDADD = libglib-2.0.la
auto_config_binscripts = gtester-report
bin_SCRIPTS = ${auto_config_binscripts}
{
GTimer *timer;
- if (!g_thread_supported ())
- g_warning ("g_timer_new() called, but GThreads not initialized yet. "
- "Call g_thread_init ().");
-
timer = g_new (GTimer, 1);
timer->active = TRUE;
COPYING \
makefile.msc
+# automake workaround
+test:
INCLUDES = -g -I$(top_srcdir) -I$(top_srcdir)/glib $(GLIB_DEBUG_FLAGS)
noinst_PROGRAMS = $(TEST_PROGS)
-progs_ldadd = $(top_builddir)/glib/libglib-2.0.la
+progs_ldadd = $(top_builddir)/glib/libglib-2.0.la
TEST_PROGS += testing