summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSebastian Wilhelmi <wilhelmi@ira.uka.de>2000-03-17 14:49:59 +0000
committerSebastian Wilhelmi <wilhelmi@src.gnome.org>2000-03-17 14:49:59 +0000
commit5e7134375eea0543c998715e03a458411906e89c (patch)
tree12f183c13cef26db56acf50f98507cd01094f337 /tests
parent3540769b17a4ab0a32544e3d1e78f3b9d00aa0bb (diff)
downloadglib-5e7134375eea0543c998715e03a458411906e89c.tar.gz
Added the missing POSIX_NO_YIELD and POSIX_NO_PRIORITIES warning messages.
2000-03-17 Sebastian Wilhelmi <wilhelmi@ira.uka.de> * configure.in: Added the missing POSIX_NO_YIELD and POSIX_NO_PRIORITIES warning messages. * configure.in: Use AC_TRY_RUN instead of AC_TRY_LINK, to test for real thread support. On solaris pthread_create can be linked to even in -lc, but it doesn't work then. * configure.in: Don't use priorities for threads, when the minimal/maximal priorities couldn't be determined at configure time. * configure.in, gthread.c: Always define GSystemThread in glibconfig.h to represent a system thread. * configure.in: Do not use native recursive threads, when possibe. We use some features, that they do not expose (namely the depth counter). * glib.h, gthread.c: Redefined GStaticRecMutex. The functions are now implemented in a different way, which should be way faster. Alsothere are now functions g_static_rec_mutex_unlock_full and g_static_rec_mutex_lock_full to leave/enter a recursive mutex completly. * gthread.c (g_thread_self): Do not test the system_thread to be non-zero to speed things up. * gthread.c (g_mutex_init): Therefore set the system_thread of the main thread here. * tests/thread-test.c: Rerun all tests once again, but this time we fool the system into thinking, that the available thread system is not native, but userprovided. * gthread/gthread-posix.c: Don't use priorities for threads, when the minimal/maximal priorities couldn't be determined at configure time. * gthread/gthread-posix.c: Don't check for errors, when setting the scope of a tread to system, as some posix implementations can't do that and we don't want the thing to fail because of that.
Diffstat (limited to 'tests')
-rw-r--r--tests/thread-test.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/tests/thread-test.c b/tests/thread-test.c
index 300e55e93..2cf30f01d 100644
--- a/tests/thread-test.c
+++ b/tests/thread-test.c
@@ -221,6 +221,15 @@ test_g_static_rw_lock ()
}
/* run all the tests */
+void
+run_all_tests()
+{
+ test_g_mutex ();
+ test_g_static_rec_mutex ();
+ test_g_static_private ();
+ test_g_static_rw_lock ();
+}
+
int
main (int argc,
char *argv[])
@@ -229,10 +238,15 @@ main (int argc,
implementation is available */
#if defined(G_THREADS_ENABLED) && ! defined(G_THREADS_IMPL_NONE)
g_thread_init (NULL);
- test_g_mutex ();
- test_g_static_rec_mutex ();
- test_g_static_private ();
- test_g_static_rw_lock ();
+ run_all_tests ();
+
+ /* Now we rerun all tests, but this time we fool the system into
+ * thinking, that the available thread system is not native, but
+ * userprovided. */
+
+ g_thread_use_default_impl = FALSE;
+ run_all_tests ();
+
#endif
return 0;
}