Commit 689a9e4b authored by Matthias Clasen's avatar Matthias Clasen

Revert the patch for bug 527214 and related changes. GTimer

        is supposed to work without threads.


svn path=/trunk/; revision=6943
parent ab81018b
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
......
......@@ -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
......
......@@ -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.
......
......@@ -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
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -507,7 +507,6 @@ main (int argc,
char *argv[])
{
g_type_init ();
g_thread_init (0);
g_test_init (&argc, &argv, NULL);
......
......@@ -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 */
......
......@@ -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);
......
......@@ -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}
......
......@@ -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;
......
......@@ -62,3 +62,5 @@ EXTRA_DIST = \
COPYING \
makefile.msc
# automake workaround
test:
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment