Commit graph

28 commits

Author SHA1 Message Date
Pav Lucistnik
efcc47c1e7 - Fix build on CURRENT with GCC 4.2
Submitted by:	tegge (maintainer)
2007-07-03 08:38:00 +00:00
Tor Egge
18eb964d17 Correct retrieval of stack address and size when getting the current
thread attributes for the main thread.

Add emulation of native threads (libc_r) method of getting the current
thread attributes (pthread_attr_get_np()) and adjust emulation of native
threads pthread_attr_getstackaddr() to return bottom of stack instead of
top of stack.

Correct emulation of native threads pthread_mutexattr_settype() when
selecting recursive mutexes.  Previously, the argument conversion before
calling the linuxthreads version of pthread_mutexattr_setattr() ended up
selecting errorcheck mutexes instead of recursive mutexes.
2007-03-21 21:40:24 +00:00
Tor Egge
20fa307449 Check for NO_PIC and NO_PROFILE on FreeBSD >= 6.0.
Add sys/_pthreadtypes.h to allow compilation on FreeBSD >= 6.0.

Initialize signal trampoline variables earlier to avoid race in wrapper
around sigaction.

Fix known API wrapper bugs.

Port compile time options:

  Add option for using an alternate restart signal instead of SIGUSR2.

  Add options for adjustment of maximum thread stack size and maximum
  number of threads.

  Make all options start with LINUXTHREADS_

Note that complete FreeBSD source matching userland must be installed
in /usr/src when compiling this port.
2005-07-22 22:20:21 +00:00
Tor Egge
fde4540874 Stop wrapping gethost* functions on 5.2-CURRENT. 2004-03-21 20:22:14 +00:00
Tor Egge
deaa638071 Add option to ignore posix priority scheduling.
Add threadsafe versions of some libc functions on FreeBSD 4.x.
Register liblgcc_r_pic.a as installed for FreeBSD 5.x.
2004-02-27 23:32:55 +00:00
Tor Egge
909179ec64 Restore gethostbyaddr_r wrapper and remove getpw{nam,uid}_r wrappers for
newer versions of FreeBSD 5.X.

Drop use of deprecated AINC variable.

Reenable use of ld(1) to restore the LINUXTHREADS_WRAP_API option.

Rename __thread to __xthread in prototypes to avoid conflict with
new gcc keyword.

Bump port revision.
2003-07-14 12:15:03 +00:00
Tor Egge
f390ff8ee2 Add new experimental option, LINUXTHREADS_WRAP_API, that adds wrapper
functions providing most of the native threads API while avoiding name
clashes by transparently prefixing all function names that directly
provide the linuxthreads API.
2003-06-09 03:48:31 +00:00
Tor Egge
ca5b596b05 Make detection of unsafe calls to exit() optional and not default.
Reviewed by:	mbr
2003-02-25 00:27:37 +00:00
Tor Egge
37cccc341b Fix build failure on 5.0-CURRENT by including necessary headers. 2002-11-19 16:07:02 +00:00
Tor Egge
d573a7ff4e Let main thread do an exit(1) instead of an exit(0) on unclean program
termination (multiple active threads).
2002-09-06 14:57:50 +00:00
Tor Egge
05e2e6dbaf Register PIC archives when INSTALL_PIC_ARCHIVE has been defined.
Defining INSTALL_LIBLTHREAD_PIC_ARCHIVE causes installation and
registration of PIC archive for liblthread, which can be used to
generate a shared liblthread library for a different gcc installation.
Bump port revision.
2002-06-18 20:32:21 +00:00
Tor Egge
7c73d7524c Build linuxthreads version of libstdc++ and libsupc++ under 5.0-CURRENT.
Don't misuse DESTDIR when building linuxthreads version of libgcc.
Fix varargs warning under 5.0-CURRENT.
Don't try to register profiled libraries when NOPROFILE has been specified.
Don't try to register shared libraries when NOPIC has been specified.
Bump port revision.

PR:		38876
2002-06-08 18:27:19 +00:00
Tor Egge
b20aef1bb8 Fix hang caused by a thread calling exit():
- Block cancel signal while creating new thread to avoid losing
    the signal.

  - Terminate the process with _exit(1) if it's unsafe to continue
    calling atexit functions and destructors.
2002-04-22 16:50:02 +00:00
Tor Egge
d48c47551a Handle internal race that caused pthread_cond_timedwait() to block
waiting for a signal that wasn't sent.
2001-09-13 16:01:44 +00:00
Tor Egge
b55a292b53 Backout library major number bump. It wasn't needed. Additionally,
ldconfig -r didn't list the library, making it impossible for other
ports to depend on the linuxthreads port.
2001-07-01 17:36:25 +00:00
Tor Egge
71819868ea Update from version 2.1.3 to 2.2.3 of LinuxThreads. 2001-06-14 01:34:18 +00:00
Tor Egge
3c409910e0 Use __error() from liblthread instead of the libc version. 2001-02-26 14:09:46 +00:00
Tor Egge
6938e8f7c5 Reference _flockfile to ensure that the linuxthreads version is used. 2001-02-25 09:15:19 +00:00
Tor Egge
ea51d128f0 Initialize attributes for new threads with default values when a NULL
pthread_attr_t is provided as argument to pthread_create.

liblgcc_r_pic.a no longer exists.

Put the liblgcc_r.a version of __get_eh_info() and __register_frame_info()
into the shared linuxthreads library to avoid using the incompatible
libgcc.a version.  Shared libraries that use exceptions still represent a
problem if linked before the linuxthreads library.

Compile liblgcc_r.a before the main linuxthreads library to provide
the object files that contains __get_eh_info() and __register_frame_info().

Add minimal wrappers for native thread library functions used by
5.0-CURRENT libc.  The wrappers try to call corresponding functions
in the linuxthreads library after performing argument conversion.
2001-02-20 00:34:57 +00:00
Jason Evans
06bce9d9d7 Use the correct pthread.h when compiling liblgcc_r. Allow thread stacks
larger than 16kB.  Make sure to call global destructors during shutdown.

PR:		ports/22429
Submitted by:	tegge
2000-11-06 19:43:33 +00:00
Jason Evans
7f8cdb6f00 Update from version 2.1.2 to 2.1.3 of LinuxThreads. 2000-05-24 04:14:41 +00:00
Jason Evans
d66ea1cc3d Back out changes to lock functions passed to dllockinit().
Don't compile the lockfile.c that comes with LinuxThreads.
2000-01-29 03:15:24 +00:00
Jason Evans
85bfda41f7 Don't use the pthreads rwlock implementation for dllockinit(), since it
causes infinite recursion while trying to initialize the internal library
state.  Instead, use a simple spinlock-based rwlock implementation.

Make minor cancellation cleanups.
2000-01-25 22:37:11 +00:00
Jason Evans
1c274b738e Clean up the port considerably, and fix several serious bugs. There are
still some problems, at least with signal handling and locking on SMP.

Submitted by:	dick
2000-01-04 00:05:24 +00:00
Jason Evans
d721b24892 Make __pthread_attr_init() pthread_attr_init().
Submitted by:	"Russell L. Carter" <rcarter@pinyon.org>
1999-12-28 18:11:25 +00:00
Jason Evans
4ebeef489c Update to the most recent release of LinuxThreads, glibc-linuxthreads-2.1.2,
which is rather tightly coupled with GNU libc, unlike the older version
of this port.

LinuxThreads has added many features since it was integrated with GNU libc,
which means that a number of interfaces that were borrowed from libc_r are
no longer needed.

This updated port required a lot of reworking of the port, so there are
likely to be new bugs.
1999-12-24 01:12:08 +00:00
Julian Elischer
a49359d57b Submitted by: "Russell L. Carter" <rcarter@consys.com>
more tuning
1999-12-02 02:14:16 +00:00
Julian Elischer
3254235ecc Reviewed by: Russell Carter
Submitted by:	"Richard Seaman, Jr." <dick@tar.com>

Native FreeBSD port of the linuxthreads library
Includes added files and stuff you need to add to the rest of your system.
This is for -current  I'm sure Richard's older version might be
a good place to start for a 3.x version.
1999-11-30 09:07:29 +00:00