Revert the patch for bug 527214 and related changes. GTimer
authorMatthias Clasen <matthiasc@src.gnome.org>
Tue, 27 May 2008 16:00:51 +0000 (16:00 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 27 May 2008 16:00:51 +0000 (16:00 +0000)
        is supposed to work without threads.

svn path=/trunk/; revision=6943

14 files changed:
ChangeLog
docs/reference/glib/tmpl/threads.sgml
docs/reference/glib/tmpl/timers.sgml
gio/tests/Makefile.am
gio/tests/data-input-stream.c
gio/tests/data-output-stream.c
gio/tests/g-file-info.c
gio/tests/g-file.c
gio/tests/live-g-file.c
gio/tests/memory-input-stream.c
glib/Makefile.am
glib/gtimer.c
glib/pcre/Makefile.am
glib/tests/Makefile.am

index 636ef04..8eab6f6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+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 
index f0c59d0..3cbbbfc 100644 (file)
@@ -162,20 +162,22 @@ the thread system by calling g_thread_init(). Most of the time you
 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
index 5229095..8e3cfa8 100644 (file)
@@ -11,8 +11,10 @@ This is done somewhat differently on different platforms, and can be tricky to
 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 ##### -->
@@ -34,9 +36,6 @@ Opaque datatype that records a start time.
 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.
 
index 8f2bb83..6f3c650 100644 (file)
@@ -12,7 +12,6 @@ INCLUDES =                    \
 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
 
index b979066..6abc7c4 100644 (file)
@@ -318,7 +318,6 @@ main (int   argc,
       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);
index 56edbfd..1a7e1ae 100644 (file)
@@ -282,7 +282,6 @@ main (int   argc,
       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);
index edbd319..d3ed5c9 100644 (file)
@@ -117,7 +117,6 @@ main (int   argc,
       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);
index 2618631..d512c93 100644 (file)
@@ -507,7 +507,6 @@ main (int   argc,
       char *argv[])
 {
   g_type_init ();
-  g_thread_init (0);
   g_test_init (&argc, &argv, NULL);
   
   
index a5ece7f..203fcb2 100644 (file)
@@ -1107,7 +1107,6 @@ main (int argc, char *argv[])
 
   /*  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  */ 
index de3f661..247613c 100644 (file)
@@ -70,7 +70,6 @@ main (int   argc,
       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);
index 0be005d..fbdf900 100644 (file)
@@ -316,7 +316,7 @@ if OS_UNIX
 
 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}
index 83f45ee..a29e39d 100644 (file)
@@ -69,10 +69,6 @@ g_timer_new (void)
 {
   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;
 
index c5aedb6..bbea2e4 100644 (file)
@@ -62,3 +62,5 @@ EXTRA_DIST =                          \
                COPYING                 \
                makefile.msc
 
+# automake workaround
+test:
index 62b7ee7..26f6d37 100644 (file)
@@ -3,7 +3,7 @@ include $(top_srcdir)/Makefile.decl
 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