glibc/linuxthreads/README.Xfree3.2

353 lines
9.0 KiB
Groff
Raw Normal View History

LinuxThreads library. 1998-03-11 00:42 Wolfram Gloger <wmglo@dent.med.uni-muenchen.de> * linuxthreads/manager.c: Enable resetting of the thread scheduling policy to SCHED_OTHER when the parent thread has a different one. 1998-02-01 13:51 Ulrich Drepper <drepper@cygnus.com> * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define _POSIX_ASYNCHRONOUS_IO. * sysdeps/pthread/pthread.h: Define bits for Unix98 variants of mutexes. * mutex.c: Implement new mutex types. * internals.h: Include <signal.h>. * libpthread.map: Add __erno_location and __h_errno_location. * errno.c: Return pointer to variable actually in use. This might not be the one in the thread structure. * internals.h (struct _pthread_descr_struct): Add new fields p_errnop and p_h_errnop. * manager.c (__pthread_manager): Set p_errnop and p_h_errnop member of manager thread structure. (pthread_handle_create): Set p_errnop and p_h_errnop members for new thread. * pthread.c: Adapt initializer for thread structures. (__pthread_initial_thread): Set p_errnop and p_h_errnop member. (__pthread_reset_main_thread): Reset p_errnop and p_h_errnop of current thread to global variables. 1998-01-31 17:27 Ulrich Drepper <drepper@cygnus.com> * rwlock.c: New file. * Makefile (libpthread-routines): Add rwlock. * sysdeps/pthread/pthread.h: Define data structures and declare functions. * libpthread.map: Add new functions. 1997-12-18 13:50 Philip Blundell <pb@nexus.co.uk> * sysdeps/arm/pt-machine.h: New file; add ARM support. * sysdeps/arm/Implies: likewise. * README: Document it. 1997-12-13 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * signals.c: Remove unneeded initializer for sigwaited, saving a 1997-04-11 01:18 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * semaphore.c (sem_init): Set sem_spinlock only if available. 1997-12-04 01:48 Ulrich Drepper <drepper@cygnus.com> * mutex.c: Implement PTHREAD_MUTEX_CHECKERROR. * sysdeps/pthread/pthread.h: Define PTHREAD_MUTEX_CHECKERROR. * Makefile: Update from LinuxThreads 0.7. * internals.h. Likewise. * manager.c: Likewise. * mutex.c: Likewise. * pthread.c: Likewise. * signals.c: Likewise. * specific.c: Likewise. * Examples/ex3.c: Likewise. 1997-11-20 18:13 Ulrich Drepper <drepper@cygnus.com> * pthread.c (__pthread_reset_main_thread): Close pipe only if still open. 1997-10-29 05:38 Ulrich Drepper <drepper@cygnus.com> * wrapsyscall.c: Add socket functions which are also cancelation points. 1997-10-19 21:40 Wolfram Gloger <wg@wolfram.dent.med.uni-muenchen.de> * specific.c (__libc_internal_tsd_set, __libc_internal_tsd_get): New functions for fast thread specific data within libc. * internals.h: Add new array p_libc_specific to struct _pthread_descr_struct. * sysdeps/pthread/bits/libc-lock.h: Declare new functions. 1997-10-13 05:39 Ulrich Drepper <drepper@cygnus.com> * semaphore.h: Add __BEGIN_DECLS/__END_DECLS. Reported by Ralf Corsepius <corsepiu@faw.uni-ulm.de>. 1997-08-29 03:05 Ulrich Drepper <drepper@cygnus.com> * internals.h (struct _pthread_descr_struct): Add definitions for two-level specific key handling. * manager.c (pthread_handle_create): Initialize specific memory array. * specific.c: Implement two-level key handling. * weaks.c: Don't provide dummy key handling. * sysdeps/pthread/bits/libc-lock.h: Typedef __libc_lock_t (no #define). Add definition of __libc_key_t. * sysdeps/unix/sysv/linux/bits/local_lim.h: Define PTHREAD_KEYS_MAX as 1024. Add definition of _POSIX_THREAD_DESTRUCTOR_ITERATIONS and PTHREAD_DESTRUCTOR_ITERATIONS. * manager.c (pthread_handle_create): Compare mmap result with MAP_FAILED. * ptfork.c: Rename to __pthread_atfork and make old name a weak alias. * sysdeps/pthread/bits/pthread.h: Add prototype for __pthread_atfork. 1997-08-22 19:04 Richard Henderson <rth@cygnus.com> sysdeps/sparc -> sysdeps/sparc/sparc32 sysdeps/sparc64 -> sysdeps/sparc/sparc64 * internals.h: Change definition of THREAD_SELF to be an expression, not a statement that did a return. * sysdeps/alpha/pt-machine.h (THREAD_SELF): Update accordingly. * sysdeps/sparc/sparc32/pt-machine.h (THREAD_SELF, INIT_THREAD_SELF): Follow Solaris and use a "system reserved" register (%g6) to hold the thread descriptor. * sysdeps/sparc/sparc64/pt-machine.h: Likewise. 1997-08-03 00:09 Ulrich Drepper <drepper@cygnus.com> * mutex.c: Correct pthread_once. Patch by Xavier Leroy. * sysdeps/pthread/pthread.h: Add prototype for __pthread_once. * sysdeps/pthread/bits/pthread.h: Add macros for __libc_once. * semaphore.c: Include spinlock.h only when needed. * specific.c (__pthread_setsepcific, __pthread_getspecific): Reject keys for entries not in use. * weaks.c: Implement key handling functions for real. 1997-06-29 01:04 Richard Henderson <richard@gnu.ai.mit.edu> Initial sparc64-linux support: * linuxthreads/sysdeps/sparc64/Implies: New file. * linuxthreads/sysdeps/sparc64/pt-machine.h: Likewise. 1997-06-29 00:48 Ulrich Drepper <drepper@cygnus.com> * semaphore.c: Include spinlock.h at correct place. Patch by HJ Lu. 1997-06-13 10:06 Richard Henderson <rth@tamu.edu> The Great Bit File Move: * sysdeps/alpha/semaphorebits.h: -> .../bits/semaphore.h. * sysdeps/powerpc/semaphorebits.h: Likewise. * sysdeps/pthread/cmpxchg/semaphorebits.h: Likewise. * sysdeps/pthread/no-cmpxchg/semaphorebits.h: Likewise. * sysdeps/pthread/libc-lock.h: -> bits/ * sysdeps/pthread/stdio-lock.h: Likewise. * sysdeps/unix/sysv/linux/local_lim.h: Likewise. * sysdeps/unix/sysv/linux/posix_opt.h: Likewise. * semaphore.h: Likewise. * sysdeps/pthread/pthread.h: Likewise. * lockfile.c: <foo.h> -> <bits/foo.h>. * semaphore.h: Likewise. * Makefile: (headers): foo.h -> bits/foo.h. * sysdeps/pthread/Makefile: Likewise. 1997-04-11 01:18 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * semaphore.c (sem_init): Set sem_spinlock only if available. * sysdeps/m68k/pt-machine.h (testandset, __compare_and_swap): Fix asm constraints. 1997-04-09 03:00 Ulrich Drepper <drepper@cygnus.com> Update from LinuxThreads 0.6. * attr.c (pthread_attr_getdetachstate): Use __sched_get_priority_max and __sched_get_priority_min instead of names without `__'. * manager.c: Rewrite large parts to implement opaque pthread_t. * cancel.c: Adapt for opaque pthread_t type. * condvar.c: Likewise. * errno.c: Likewise. * join.c: Likewise. * mutex.c: Likewise. * pthread.c: Likewise. * signals.c: Likewise. * specific.c: Likewise. * restart.h: Likewise. * queue.h: Likewise. * Examples/ex3.c: Likewise. * Examples/ex4.c: Likewise. * sysdeps/pthread/pthread.h: Likewise. * pthread.c: Accumulate time for all threads in thread manager. * semaphore.c: Implement fallback implementation for architectures sometimes missing compare-exchange operations. * cancel.c (pthread_cancel): Validate handle argument. * join.c (pthread_join): Likewise. (pthread_detach): Likewise. * signals.c (pthread_kill): Likewise. * spinlock.h (acquire): Use __sched_yield not sched_yield. * queue.h (enqueue): Enqueue thread according to priority. * internals.c (struct pthread_start_args): New struct for passing args to cloning function. (struct _pthread): Rename to _pthread_descr_struct and adapt for opaque pthread_t. * Examples/Makefile (clean): Pass -f option to rm. * sysdeps/i386/pt-machine.h: Add check for compare-exchange instruction and define TEST_FOR_COMPARE_AND_SWAP. * sysdeps/i386/i486/pt-machine.h: Removed. * sysdeps/unix/sysv/linux/local_lim.h (PTHREAD_THREADS_MAX): Increase to 1024. 1997-04-04 16:38 Ulrich Drepper <drepper@cygnus.com> * restart.h (suspend): Clear p_signal before suspending. (suspend_with_cancellation): Likewise. Patch by Xavier Leroy <Xavier.Leroy@inria.fr>. * weaks.c: Make __pthread_key_create return 1. * sysdeps/pthread/libc-lock.h: Define __libc_key_create, __libc_getspecific, __libc_setspecific, and __libc_key_t. * sysdeps/pthread/stdio-lock.h: Don't care for implementation not using libio. 1997-03-19 15:13 Miguel de Icaza <miguel@nuclecu.unam.mx> * sysdeps/sparc/pt-machine (RELEASE): Fix. 1997-03-01 07:55 Geoff Keating <geoffk@ozemail.com.au> * sysdeps/powerpc/Implies: Added. * sysdeps/powerpc/pt-machine.h: Added. * sysdeps/powerpc/semaphorebits.h: Added. 1997-01-22 01:22 Ulrich Drepper <drepper@cygnus.com> * linuxtheads/pthread.c (__pthread_initial_thread): Correct initializer. (__pthread_manager_thread): Likewise. Reported by Andreas Jaeger. 1997-01-18 22:15 Richard Henderson <rth@tamu.edu> Since sigset_t no longer fits in a register, we can't pass in the thread's initial mask so easily. Take this opportunity to simplify the clone implementation by only accepting a single void* argument. * linuxthreads/manager.c (__pthread_manager): Put thread vitals in the thread struct instead of as arguments through clone. (pthread_start_thread): Look for them there. * linuxthreads/internals.h (struct _pthread): Add p_initial_fn, p_initial_fn_arg, p_initial_mask. Fix __pthread_manager proto. * linuxthreads/pthread.c (pthread_initialize_manager): Revise clone invocation.
1998-03-11 13:42:25 +01:00
This file describes how to make a threaded X11R6.
You need the source-code of XFree-3.2. I used the sources of X11R6.1
(files: xc-1.tar.gz xc-2.tar.gz xc-3.tar.gz) and the patches to
XFree-3.2 (files: README.X11.patch R6.1pl1-3.2.diff.gz cfont32.tgz).
Untar the xc-?.tar.gz files in a directory called XF3.2 and apply
the XFree-3.2 patches as described in README.X11.patch or use the
whole XFree86 source.
Now apply the thread patch with
patch -p0 < XF3.2.xc.diff
Go to the XF3.2/xc directory and make the whole thing:
nice make World >& world.log &
tail -f world.log
Wait a few hours or interrupt the process after the shared libs
are made. The shared libs are:
XF3.2/xc/lib/ICE/libICE.so.6.0*
XF3.2/xc/lib/PEX5/libPEX5.so.6.0*
XF3.2/xc/lib/SM/libSM.so.6.0*
XF3.2/xc/lib/X11/libX11.so.6.1*
XF3.2/xc/lib/XIE/libXIE.so.6.0*
XF3.2/xc/lib/XThrStub/libXThrStub.so.6.0*
XF3.2/xc/lib/Xaw/libXaw.so.6.1*
XF3.2/xc/lib/Xext/libXext.so.6.1*
XF3.2/xc/lib/Xi/libXi.so.6.0*
XF3.2/xc/lib/Xmu/libXmu.so.6.0*
XF3.2/xc/lib/Xt/libXt.so.6.0*
XF3.2/xc/lib/Xtst/libXtst.so.6.1*
(The Program dga didn't compile, but I have not check out why.)
Now you can copy the resulting libs
cp XF3.2/xc/lib/*/*.so.?.? /usr/X11R6/lib/
and create some links
cd /usr/X11R6/lib/
ln -s libXThrStub.so.6.0 libXThrStub.so.6
ln -s libXThrStub.so.6 libXThrStub.so
or use make install (not tested, and needs new configuration).
It is possible with the libXThrSub to compile X11 programs without linking
libpthread to them and not necessary to recompile already installed
unthreaded X11 programs, because libXThrSub keeps the dynamic linker quit.
On the other hand you can link libpthread to a X11 program to use threads.
I used linux 2.0.23 and libc 5.4.7 .
Hans-Helmut B<>hmann hans@expmech.ing.tu-bs.de
----------------------------------------------------------------------------
XF3.2.xc.diff:
-----------------------------------------------------------------------------
diff -u --recursive XF3.2.orig/xc/config/cf/linux.cf XF3.2/xc/config/cf/linux.cf
--- XF3.2.orig/xc/config/cf/linux.cf Sun Nov 10 17:05:30 1996
+++ XF3.2/xc/config/cf/linux.cf Sun Nov 10 16:30:55 1996
@@ -61,6 +61,14 @@
#define HasSnprintf YES
#endif
+#define HasPosixThreads YES
+#define ThreadedX YES
+#define BuildThreadStubLibrary YES
+#define NeedUIThrStubs YES
+#define HasThreadSafeAPI NO
+#define SystemMTDefines -D_REENTRANT
+#define ThreadsLibraries -lpthread
+
#define AvoidNullMakeCommand YES
#define StripInstalledPrograms YES
#define CompressAllFonts YES
@@ -158,7 +166,7 @@
#define LdPostLib /* Never needed */
#ifdef i386Architecture
-#define OptimizedCDebugFlags DefaultGcc2i386Opt -m486
+#define OptimizedCDebugFlags DefaultGcc2i386Opt -m486 -pipe
#define StandardDefines -Dlinux -D__i386__ -D_POSIX_SOURCE \
-D_BSD_SOURCE -D_SVID_SOURCE -DX_LOCALE
#define XawI18nDefines -DUSE_XWCHAR_STRING -DUSE_XMBTOWC
diff -u --recursive XF3.2.orig/xc/config/cf/lnxLib.tmpl XF3.2/xc/config/cf/lnxLib.tmpl
--- XF3.2.orig/xc/config/cf/lnxLib.tmpl Sun Nov 10 17:05:30 1996
+++ XF3.2/xc/config/cf/lnxLib.tmpl Sat Nov 9 14:52:39 1996
@@ -19,7 +19,7 @@
#define CplusplusLibC
-#define SharedX11Reqs
+#define SharedX11Reqs -L$(BUILDLIBDIR) -lXThrStub
#define SharedOldXReqs $(LDPRELIB) $(XLIBONLY)
#define SharedXtReqs $(LDPRELIB) $(XLIBONLY) $(SMLIB) $(ICELIB)
#define SharedXawReqs $(LDPRELIB) $(XMULIB) $(XTOOLLIB) $(XLIB)
diff -u --recursive XF3.2.orig/xc/include/Xthreads.h XF3.2/xc/include/Xthreads.h
--- XF3.2.orig/xc/include/Xthreads.h Thu Dec 7 02:19:09 1995
+++ XF3.2/xc/include/Xthreads.h Sat Nov 9 01:04:55 1996
@@ -229,12 +229,12 @@
#define xcondition_wait(c,m) pthread_cond_wait(c,m)
#define xcondition_signal(c) pthread_cond_signal(c)
#define xcondition_broadcast(c) pthread_cond_broadcast(c)
-#ifdef _DECTHREADS_
+#if defined(_DECTHREADS_) || defined(linux)
static xthread_t _X_no_thread_id;
#define xthread_have_id(id) !pthread_equal(id, _X_no_thread_id)
#define xthread_clear_id(id) id = _X_no_thread_id
#define xthread_equal(id1,id2) pthread_equal(id1, id2)
-#endif /* _DECTHREADS_ */
+#endif /* _DECTHREADS_ || linux */
#if _CMA_VENDOR_ == _CMA__IBM
#ifdef DEBUG /* too much of a hack to enable normally */
/* see also cma__obj_set_name() */
diff -u --recursive XF3.2.orig/xc/lib/X11/util/makekeys.c XF3.2/xc/lib/X11/util/makekeys.c
--- XF3.2.orig/xc/lib/X11/util/makekeys.c Mon Apr 18 02:22:22 1994
+++ XF3.2/xc/lib/X11/util/makekeys.c Sat Nov 9 00:44:14 1996
@@ -73,7 +73,7 @@
register char c;
int first;
int best_max_rehash;
- int best_z;
+ int best_z = 0;
int num_found;
KeySym val;
diff -u --recursive XF3.2.orig/xc/lib/XThrStub/Imakefile XF3.2/xc/lib/XThrStub/Imakefile
--- XF3.2.orig/xc/lib/XThrStub/Imakefile Sun Nov 10 17:08:12 1996
+++ XF3.2/xc/lib/XThrStub/Imakefile Sat Nov 9 19:04:51 1996
@@ -25,7 +25,7 @@
DEFINES = $(ALLOC_DEFINES)
INCLUDES =
SRCS = $(STUBSRCS)
- OBJS = $(STUBOBJS
+ OBJS = $(STUBOBJS)
LINTLIBS = $(LINTXLIB)
#include <Library.tmpl>
diff -u --recursive XF3.2.orig/xc/lib/XThrStub/UIThrStubs.c XF3.2/xc/lib/XThrStub/UIThrStubs.c
--- XF3.2.orig/xc/lib/XThrStub/UIThrStubs.c Sun Nov 10 17:08:12 1996
+++ XF3.2/xc/lib/XThrStub/UIThrStubs.c Sun Nov 10 15:14:55 1996
@@ -37,16 +37,43 @@
* specificies the thread library on the link line.
*/
+#if defined(linux)
+#include <pthread.h>
+#else
#include <thread.h>
#include <synch.h>
+#endif
+#if defined(linux)
+static pthread_t no_thread_id;
+#endif /* defined(linux) */
+
+#if defined(linux)
+#pragma weak pthread_self = _Xthr_self_stub_
+pthread_t
+_Xthr_self_stub_()
+{
+ return(no_thread_id);
+}
+#else /* defined(linux) */
#pragma weak thr_self = _Xthr_self_stub_
thread_t
_Xthr_self_stub_()
{
return((thread_t)0);
}
+#endif /* defined(linux) */
+#if defined(linux)
+#pragma weak pthread_mutex_init = _Xmutex_init_stub_
+int
+_Xmutex_init_stub_(m, a)
+ pthread_mutex_t *m;
+ __const pthread_mutexattr_t *a;
+{
+ return(0);
+}
+#else /* defined(linux) */
#pragma weak mutex_init = _Xmutex_init_stub_
int
_Xmutex_init_stub_(m, t, a)
@@ -56,7 +83,17 @@
{
return(0);
}
+#endif /* defined(linux) */
+#if defined(linux)
+#pragma weak pthread_mutex_destroy = _Xmutex_destroy_stub_
+int
+_Xmutex_destroy_stub_(m)
+ pthread_mutex_t *m;
+{
+ return(0);
+}
+#else /* defined(linux) */
#pragma weak mutex_destroy = _Xmutex_destroy_stub_
int
_Xmutex_destroy_stub_(m)
@@ -64,7 +101,17 @@
{
return(0);
}
+#endif /* defined(linux) */
+#if defined(linux)
+#pragma weak pthread_mutex_lock = _Xmutex_lock_stub_
+int
+_Xmutex_lock_stub_(m)
+ pthread_mutex_t *m;
+{
+ return(0);
+}
+#else /* defined(linux) */
#pragma weak mutex_lock = _Xmutex_lock_stub_
int
_Xmutex_lock_stub_(m)
@@ -72,7 +119,17 @@
{
return(0);
}
+#endif /* defined(linux) */
+#if defined(linux)
+#pragma weak pthread_mutex_unlock = _Xmutex_unlock_stub_
+int
+_Xmutex_unlock_stub_(m)
+ pthread_mutex_t *m;
+{
+ return(0);
+}
+#else /* defined(linux) */
#pragma weak mutex_unlock = _Xmutex_unlock_stub_
int
_Xmutex_unlock_stub_(m)
@@ -80,7 +137,18 @@
{
return(0);
}
+#endif /* defined(linux) */
+#if defined(linux)
+#pragma weak pthread_cond_init = _Xcond_init_stub_
+int
+_Xcond_init_stub_(c, a)
+ pthread_cond_t *c;
+ __const pthread_condattr_t *a;
+{
+ return(0);
+}
+#else /* defined(linux) */
#pragma weak cond_init = _Xcond_init_stub_
int
_Xcond_init_stub_(c, t, a)
@@ -90,7 +158,17 @@
{
return(0);
}
+#endif /* defined(linux) */
+#if defined(linux)
+#pragma weak pthread_cond_destroy = _Xcond_destroy_stub_
+int
+_Xcond_destroy_stub_(c)
+ pthread_cond_t *c;
+{
+ return(0);
+}
+#else /* defined(linux) */
#pragma weak cond_destroy = _Xcond_destroy_stub_
int
_Xcond_destroy_stub_(c)
@@ -98,7 +176,18 @@
{
return(0);
}
+#endif /* defined(linux) */
+#if defined(linux)
+#pragma weak pthread_cond_wait = _Xcond_wait_stub_
+int
+_Xcond_wait_stub_(c,m)
+ pthread_cond_t *c;
+ pthread_mutex_t *m;
+{
+ return(0);
+}
+#else /* defined(linux) */
#pragma weak cond_wait = _Xcond_wait_stub_
int
_Xcond_wait_stub_(c,m)
@@ -107,7 +196,17 @@
{
return(0);
}
+#endif /* defined(linux) */
+#if defined(linux)
+#pragma weak pthread_cond_signal = _Xcond_signal_stub_
+int
+_Xcond_signal_stub_(c)
+ pthread_cond_t *c;
+{
+ return(0);
+}
+#else /* defined(linux) */
#pragma weak cond_signal = _Xcond_signal_stub_
int
_Xcond_signal_stub_(c)
@@ -115,7 +214,17 @@
{
return(0);
}
+#endif /* defined(linux) */
+#if defined(linux)
+#pragma weak pthread_cond_broadcast = _Xcond_broadcast_stub_
+int
+_Xcond_broadcast_stub_(c)
+ pthread_cond_t *c;
+{
+ return(0);
+}
+#else /* defined(linux) */
#pragma weak cond_broadcast = _Xcond_broadcast_stub_
int
_Xcond_broadcast_stub_(c)
@@ -123,3 +232,15 @@
{
return(0);
}
+#endif /* defined(linux) */
+
+#if defined(linux)
+#pragma weak pthread_equal = _Xthr_equal_stub_
+int
+_Xthr_equal_stub_(t1, t2)
+ pthread_t t1;
+ pthread_t t2;
+{
+ return(1);
+}
+#endif /* defined(linux) */
-------------------------------------------------------------------------