mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-22 17:08:53 +02:00
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.
This commit is contained in:
committed by
Sebastian Wilhelmi
parent
3540769b17
commit
5e7134375e
25
glib.h
25
glib.h
@@ -1,3 +1,4 @@
|
||||
|
||||
/* GLIB - Library of useful routines for C programming
|
||||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
||||
*
|
||||
@@ -3062,24 +3063,22 @@ void g_static_private_set_for_thread (GStaticPrivate *private_key,
|
||||
GThread *thread,
|
||||
gpointer data,
|
||||
GDestroyNotify notify);
|
||||
#ifndef G_STATIC_REC_MUTEX_INIT
|
||||
/* if GStaticRecMutex is not just a differently initialized GStaticMutex,
|
||||
* the following is done:
|
||||
* This can't be done in glibconfig.h, as GStaticPrivate and gboolean
|
||||
* are not yet known there
|
||||
*/
|
||||
|
||||
typedef struct _GStaticRecMutex GStaticRecMutex;
|
||||
struct _GStaticRecMutex
|
||||
{
|
||||
GStaticMutex mutex;
|
||||
GStaticPrivate counter;
|
||||
unsigned int depth;
|
||||
GSystemThread owner;
|
||||
};
|
||||
#define G_STATIC_REC_MUTEX_INIT { G_STATIC_MUTEX_INIT, G_STATIC_PRIVATE_INIT }
|
||||
void g_static_rec_mutex_lock (GStaticRecMutex* mutex);
|
||||
gboolean g_static_rec_mutex_trylock (GStaticRecMutex* mutex);
|
||||
void g_static_rec_mutex_unlock (GStaticRecMutex* mutex);
|
||||
#define g_static_rec_mutex_get_mutex(mutex) ((mutex)->mutex)
|
||||
#endif /* G_STATIC_REC_MUTEX_INIT */
|
||||
|
||||
#define G_STATIC_REC_MUTEX_INIT { G_STATIC_MUTEX_INIT }
|
||||
void g_static_rec_mutex_lock (GStaticRecMutex *mutex);
|
||||
gboolean g_static_rec_mutex_trylock (GStaticRecMutex *mutex);
|
||||
void g_static_rec_mutex_unlock (GStaticRecMutex *mutex);
|
||||
void g_static_rec_mutex_lock_full (GStaticRecMutex *mutex,
|
||||
guint depth);
|
||||
guint g_static_rec_mutex_unlock_full (GStaticRecMutex *mutex);
|
||||
|
||||
typedef struct _GStaticRWLock GStaticRWLock;
|
||||
struct _GStaticRWLock
|
||||
|
Reference in New Issue
Block a user