Commit Graph

799 Commits

Author SHA1 Message Date
yamt a74bc62145 add comments
whitespace
2013-03-06 11:31:34 +00:00
yamt 93af5b695c add assertions 2013-03-06 11:30:56 +00:00
apb 6cee3c7cf5 Explain what PTHREAD__COMPAT is for. This comment in
src/libpthread/Makefile is adated from a comment in
src/doc/CHANGES.prev.
2013-02-25 17:04:46 +00:00
riastradh d86328195e Add pthread_condattr_setclock(3) man page link. 2013-01-31 20:57:58 +00:00
dsl 2bf5f9db37 Don't rely on sys/lwp.h includeing sys/resource.h for us. 2013-01-01 18:42:39 +00:00
christos fe230c9d39 Don't call the destructor in pthread_key_delete() following the standard. 2012-11-22 08:32:36 +00:00
christos 55f47ec332 Replace the simple implementation of pthread_key_{create,destroy}
and pthread_{g,s}etspecific functions, to one that invalidates
values of keys in other threads when pthread_key_delete() is called.
This fixes chromium, which expects pthread_key_delete() to do
cleanup in all threads.
2012-11-21 19:19:24 +00:00
christos cb292d56ab add argsused 2012-11-14 23:25:05 +00:00
uwe ed34834025 Mark up (unsupported) PTHREAD_PROCESS_SHARED with .Dv macro. 2012-11-12 23:34:50 +00:00
uwe 7fe27706ff Refer to init_routine in the DESCRIPTION section with .Fa instead of .Fn 2012-11-12 23:28:11 +00:00
uwe b5c99d4306 Use
.Vt type var No = Dv INITIALIZER;

to provide examples of static initialization in SYNOPSIS section.
.Va macro does the wrong thing (check groff PostScript output) and the
need for .Pp kludge (now dropped) should have been an indication too.

While here move static initialization example to be right after the
declaration of *_init().
2012-11-12 23:11:05 +00:00
uwe b89e4203ae Each get function "has" a set counterpart, it doesn't "contain" it. 2012-11-10 23:12:36 +00:00
apb 9d94c0263d Remove duplicate "const" modifier found by clang -Wduplicate-decl-specifier 2012-11-06 09:03:03 +00:00
rmind d79b47c370 libpthread: replace the use of obsolete sys/tree.h interface with rbtree(9). 2012-11-03 23:42:27 +00:00
wiz 2268525138 Fix pasto. 2012-11-03 09:20:36 +00:00
christos 2a29ccd3da add pthread_condattr_setclock(3) 2012-11-03 03:10:50 +00:00
christos 284dc1a8fd cast return of sysconf 2012-11-03 03:10:35 +00:00
matt 8837651bdf Use .inst instead of wfe/sev to shut up gas. 2012-09-19 07:57:14 +00:00
matt 426a76190c Only copy the ucontext_t in pthread_setcontext if _UC_TLSBASE is set.
Conditionalize the test on _UC_TLSBASE being defined.
2012-09-12 14:55:48 +00:00
manu bba80928a8 setcontext() used to be incompatible with -lpthread since it affected
the TLS pointer, therefore wrecking the pthread environement.

Some ports had _UC_TLSBASE flag or equivalent (_UC_UNIQUE on alpha)
that controlled whether setcontext() would change the TLS pointer.
This change let libpthread override setcontext() with its own version
that unsets _UC_TLSBASE, enabling safe usage of setcontext() with
-lpthread.

We also have the following required changes here:
- rename alpha's _UC_UNIQUE into _UC_TLSBASE
- add _UC_TLSBASE definition in header file for all ports
  (powerpc, sh3, sparc and sparc64 lack the implementation for now)
- introduce a libc stub that can be overriden for setcontext()
- modify MD libcs swapcontext() implementations so that they use the
  setcontext() libc stub instead of doing a plain system call.

While we are there:
- document various MD _UC_* flags in header file
- add libc and libpthread tests for swapcontext() behavior
  (hopefully helpful to spot MD problems introduced with this change)

Future work:
- Deciding whether kernel support or _UC_TLSBASE should be added for
  powerpc, sh3, sparc and sparc64 is left to portmasters
  sparc64

Approved by core@
2012-09-12 02:00:51 +00:00
matt 2f1e74f8c5 Add a pthread__smt_wake and add support for it on arm along with
pthread__smt_pause.  These are implemented using the ARM instructions
SEV (wake) and WFE (pause).  These are treated as NOPs on ARM CPUs that
don't support them.
2012-08-16 04:49:47 +00:00
drochner b0ce37c2b0 return errno if pthread_create hits the system limit, not just -1
(this is not entirely correct because it can return ENOMEM which is
not mentioned in the spec, but there are other places in pthread_create
whete ENOMEM is returned -- it at all, this should be fixed everywhere)
2012-08-15 13:28:32 +00:00
matt 234b053454 -Wfoo goes into CWARNFLAGS 2012-08-04 15:13:09 +00:00
joerg 0645d95b42 Prefer sysconf to obtain number of CPUs. 2012-08-02 12:43:41 +00:00
joerg 74a7f3e6f2 Do not mark pthread_cond_timedwait explicitly as inlineable, since it
calls pthread__self, which is static.
2012-06-15 19:20:44 +00:00
joerg 8050d45d71 Simplify check for TLS definition to not hide code. Drop it in another
place as it is redundant.
2012-05-04 12:26:33 +00:00
enami 3cdda33922 Store allocated lwpctl state in the thread actually forked,
which is the only thread lives in the child process.

The problem originally reported here:
  https://bugs.ruby-lang.org/issues/6341
2012-04-26 00:21:44 +00:00
christos 5662c2716e trailing whitespace police. 2012-04-04 17:47:03 +00:00
joerg b757af438b Disable new -Wstring-plus-int warning where needed for now.
Adjust various places that add GCC-only options to check for the active
compiler first.
2012-04-04 10:59:44 +00:00
agc 76f4f39125 Add a pthread cancel stub for sigwait, following Onno van der Linden's
analysis in PR 45131.  Kindly tested by Hisashi T Fujinaka (using csup
as the test case) with a successful outcome.

OK martin@
2012-04-04 06:29:16 +00:00
drochner e917deee9c don't reuse a dynamically allocated stack if a fixed one is requested 2012-03-22 20:01:18 +00:00
matt fa835e8c8b These directories default to WARNS?=5 2012-03-21 05:37:42 +00:00
joerg e865ac2891 Move the pthread_once alias where it belongs. 2012-03-13 01:05:55 +00:00
joerg 77bfe129a9 Move pthread_once implementation into a separate file, it doesn't depend
on the mutex implementation in any way.
2012-03-12 21:35:10 +00:00
joerg d3660af7b6 Keep track of the size of the guard area, in case we want to make it
modifiable later. Only reuse the stack if it was allocated by libpthread
and if the expected thread size matches the current stack size.
2012-03-12 20:16:52 +00:00
joerg 1d34190ecc Further refine stack allocation. If the stack was provided by the user,
don't bother with setting up a guard page. Otherwise, round up the size
to page size. Point stack inside the guarded area, without the guard
page. Fix size when mprotect failed.
2012-03-12 16:37:15 +00:00
joerg fa060fc8c7 Fix error handling 2012-03-10 18:01:10 +00:00
joerg af435e468b Use correct size. 2012-03-10 18:01:09 +00:00
drochner 677d666c8d -fix initial stacksize rounding
-minor indentation fix
2012-03-09 12:06:44 +00:00
joerg 4acff4c01b Implement sem_timedwait. 2012-03-08 21:59:24 +00:00
joerg 344a231144 Actually use the stack thread attributes when creating a new thread. 2012-03-08 16:40:45 +00:00
joerg bfcb2008c8 Fix the stack base pointer for the initial thread on !HPPA.
AT_STACKBASE is pointing to the start of the stack, which is the
upper limit on platforms where the stack grows down.
2012-03-08 16:33:45 +00:00
joerg d1de8de689 Remove libpthread's semaphore implementation and always use the kernel
one. The implementation doesn't provide an async-safe sem_post and can't
without a lot of work on the pthread primitives.

Remove bogus time out requirement in test case, it should have been
a "known failure" if anything.
2012-03-07 23:31:44 +00:00
joerg d2be1428c2 Avoid getcontext() as it triggers clobbering warnings. Use inline
assembler to get the fields directly. Saves a system call as side
effect.
2012-03-02 23:19:47 +00:00
joerg 12529f382e Fix indentation. 2012-03-02 18:11:53 +00:00
joerg a56440951d Separate pthread_t from thread stack. Drop additional alignment
restrictions on the thread stack. Remove remaining parts of stackid.
2012-03-02 18:06:05 +00:00
joerg eab3272778 ld.elf_so is reentrant. 2012-02-03 21:11:17 +00:00
joerg 71d0bcc69f Introduce __HAVE_NO___THREAD for sun2 and vax to disable the TLS usage.
Require __HAVE_TLS_VARIANT_I or __HAVE_TLS_VARIANT_II as well as
__lwp_getprivate_fast / __lwp_gettcb_fast to exist for libpthread.
Define VAX as going to use TLS variant I, if it is ever implemented.
2012-01-17 20:34:57 +00:00
wiz 6533efb150 Do not xref to itself. 2011-12-05 10:27:40 +00:00
jym f3effc5ec2 Improvements in secmodel(9). Document secmodel_register(9), _deregister(9)
and _eval(9).

Add secmodel_extensions(9), and indicate the new sysctl(7) to let
ordinary users control the CPU affinity (user_set_cpu_affinity).
2011-12-04 21:08:37 +00:00