glib r6943 - in trunk: . docs/reference/glib/tmpl gio/tests glib glib/pcre glib/tests



Author: matthiasc
Date: Tue May 27 16:00:51 2008
New Revision: 6943
URL: http://svn.gnome.org/viewvc/glib?rev=6943&view=rev

Log:
Revert the patch for bug 527214 and related changes. GTimer
        is supposed to work without threads.



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

Modified: trunk/docs/reference/glib/tmpl/threads.sgml
==============================================================================
--- trunk/docs/reference/glib/tmpl/threads.sgml	(original)
+++ trunk/docs/reference/glib/tmpl/threads.sgml	Tue May 27 16:00:51 2008
@@ -162,20 +162,22 @@
 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

Modified: trunk/docs/reference/glib/tmpl/timers.sgml
==============================================================================
--- trunk/docs/reference/glib/tmpl/timers.sgml	(original)
+++ trunk/docs/reference/glib/tmpl/timers.sgml	Tue May 27 16:00:51 2008
@@ -11,8 +11,10 @@
 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 @@
 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.
 

Modified: trunk/gio/tests/Makefile.am
==============================================================================
--- trunk/gio/tests/Makefile.am	(original)
+++ trunk/gio/tests/Makefile.am	Tue May 27 16:00:51 2008
@@ -12,7 +12,6 @@
 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
 

Modified: trunk/gio/tests/data-input-stream.c
==============================================================================
--- trunk/gio/tests/data-input-stream.c	(original)
+++ trunk/gio/tests/data-input-stream.c	Tue May 27 16:00:51 2008
@@ -318,7 +318,6 @@
       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);

Modified: trunk/gio/tests/data-output-stream.c
==============================================================================
--- trunk/gio/tests/data-output-stream.c	(original)
+++ trunk/gio/tests/data-output-stream.c	Tue May 27 16:00:51 2008
@@ -282,7 +282,6 @@
       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);

Modified: trunk/gio/tests/g-file-info.c
==============================================================================
--- trunk/gio/tests/g-file-info.c	(original)
+++ trunk/gio/tests/g-file-info.c	Tue May 27 16:00:51 2008
@@ -117,7 +117,6 @@
       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);

Modified: trunk/gio/tests/g-file.c
==============================================================================
--- trunk/gio/tests/g-file.c	(original)
+++ trunk/gio/tests/g-file.c	Tue May 27 16:00:51 2008
@@ -507,7 +507,6 @@
       char *argv[])
 {
   g_type_init ();
-  g_thread_init (0);
   g_test_init (&argc, &argv, NULL);
   
   

Modified: trunk/gio/tests/live-g-file.c
==============================================================================
--- trunk/gio/tests/live-g-file.c	(original)
+++ trunk/gio/tests/live-g-file.c	Tue May 27 16:00:51 2008
@@ -1107,7 +1107,6 @@
 
   /*  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  */ 

Modified: trunk/gio/tests/memory-input-stream.c
==============================================================================
--- trunk/gio/tests/memory-input-stream.c	(original)
+++ trunk/gio/tests/memory-input-stream.c	Tue May 27 16:00:51 2008
@@ -70,7 +70,6 @@
       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);

Modified: trunk/glib/Makefile.am
==============================================================================
--- trunk/glib/Makefile.am	(original)
+++ trunk/glib/Makefile.am	Tue May 27 16:00:51 2008
@@ -316,7 +316,7 @@
 
 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}

Modified: trunk/glib/gtimer.c
==============================================================================
--- trunk/glib/gtimer.c	(original)
+++ trunk/glib/gtimer.c	Tue May 27 16:00:51 2008
@@ -69,10 +69,6 @@
 {
   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;
 

Modified: trunk/glib/pcre/Makefile.am
==============================================================================
--- trunk/glib/pcre/Makefile.am	(original)
+++ trunk/glib/pcre/Makefile.am	Tue May 27 16:00:51 2008
@@ -62,3 +62,5 @@
 		COPYING			\
 		makefile.msc
 
+# automake workaround
+test:

Modified: trunk/glib/tests/Makefile.am
==============================================================================
--- trunk/glib/tests/Makefile.am	(original)
+++ trunk/glib/tests/Makefile.am	Tue May 27 16:00:51 2008
@@ -3,7 +3,7 @@
 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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]