Add a surrogate for thread priorities using PID niceness for systems with
authorSebastian Wilhelmi <wilhelmi@ira.uka.de>
Tue, 21 Nov 2000 15:27:44 +0000 (15:27 +0000)
committerSebastian Wilhelmi <wilhelmi@src.gnome.org>
Tue, 21 Nov 2000 15:27:44 +0000 (15:27 +0000)
commita3036a5bd2119e53bd90e9daa6182e9d26538879
tree4000b99079338e689c71611633ffa938893f1860
parent55bdf1322b6d5fbb7ca73e4f62d30c3e3485147f
Add a surrogate for thread priorities using PID niceness for systems with

2000-11-21  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

* configure.in: Add a surrogate for thread priorities using PID
niceness for systems with no thread priorities and different PIDs
for threads of the same process (most notably: Linux). Define
G_THREAD_USE_PID_SURROGATE in that case, as used by
gthread-posix.c. Also make the system thread bigger by
sizeof (long) to contain the thread's PID.

* gfileutils.c: Include stdlib.h for mkstemp prototype.

* gthread.c: Add priority range checks to the affected functions.

* gthreadpool.c: Remove unused variable.

* gthread-impl.c, gthread-posix.c, gthread-solaris.c: Removed
g_thread_map_priority function in favour of the
g_thread_priority_map array.  Initialize the array with
PRIORITY_{...}_VALUE, if available and interpolate beetween the
bounds if .._NORMAL_.. and .._HIGH_.. are not available.

* gthread-posix.c: If we should use the PID niceness as a
surrogate for thread priorities (G_THREAD_USE_PID_SURROGATE is
defined), then disable normal priority handling and use PIDs and
setpriority() instead. Depends on the thread to write its PID into
the place after the thread id right after thread creation.
19 files changed:
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
configure.in
gfileutils.c
glib/gfileutils.c
glib/gthread.c
glib/gthreadpool.c
gthread.c
gthread/ChangeLog
gthread/gthread-impl.c
gthread/gthread-posix.c
gthread/gthread-solaris.c
gthreadpool.c