Commit Graph

123 Commits

Author SHA1 Message Date
nathanw ee45767b84 printf format fixes. 2003-01-27 20:54:26 +00:00
nathanw 9ff1e2d385 Make pthread_barrier_wait() handle spurious wakeups from pthread__block()
by adding a generation number to the barrier structure and incrementing it
when the barrier fires.

XXX this is an ABI change for anything using barriers, but the library is
new enough and nothing in the tree uses barriers so I'm going to let it
slide. Using the private data pointer for a field that will always be present
would be excessive.
2003-01-25 00:47:05 +00:00
nathanw fe8e8dad4a More signal rearranging:
- Signal handlers now simply continue executing the current thread,
   rather than trying to put themselves back on the queue that they came
   from, which was rather fragile. As a result, all callers of
   pthread__block() must be prepared to handle spurious wakeups.

 - When a signal arrives for a thread that is blocked in the kernel,
   note this in another field in pthread_st and set a flag. Process the
   signal and set up the trampoline for the handler *after* the thread
   unblocks, so that both the trampoline and the returned state from
   the kernel are preserved.

 - Factor out some code into a pthread__deliver_signal() routine;
   the signal-taking code in pthread_sigmask() should be able to use this
   soon.

This is still gross, and there are still some terrible MP issues lurking here,
but progress crawls along.
2003-01-25 00:43:38 +00:00
nathanw 564fe117cc Make pthread_join() accomodate spurious wakeups from pthread__block(). 2003-01-25 00:37:01 +00:00
jdolecek 254ff213ae unlock pt_statelock _after_ changing pt_state, not before
problem found and fix suggested by Nick Hudson
2003-01-24 17:43:45 +00:00
thorpej c04d6591c0 Correct omission in notice. 2003-01-24 01:54:02 +00:00
thorpej c184191ce3 p1003.1b semaphore manual pages have been moved to librt. 2003-01-24 01:53:27 +00:00
thorpej 1b4d724c8e sem_init(): oops, only destroy the ksem on error if it is a ksem. 2003-01-22 23:18:06 +00:00
thorpej c151b13c1f Rewrite to use our internal scheduling primitives. 2003-01-22 22:51:42 +00:00
scw b5ca8aee09 Yay! Working pthreads for sh5. 2003-01-22 13:52:48 +00:00
scw 04c6e0b141 pthread__lock_ras_start and pthread__lock_ras_end need to be declared
as function pointers, not character arrays, for the benefit of
platforms (e.g. SH5) where the two types are quite distinct.
2003-01-22 13:52:03 +00:00
scw 5f7bdeae84 Need to include <string.h> for memcmp() prototype. 2003-01-22 13:49:14 +00:00
nathanw dc651e62df Don't bother acquiring the tsd_lock and reading the destructor function
if the corresponding TSD entry is empty.

Cuts down lock/unlock pairs for this operation from 256 to the number
of active TSD entries; sicne this is done when every thread exits, it saves
many total lock/unlock pairs.
2003-01-21 23:29:22 +00:00
wiz ab206b65a6 New sentence, new line. 2003-01-21 11:48:03 +00:00
wiz 2caa76989f Replace -1 with \-1. 2003-01-21 11:47:32 +00:00
scw ff288f9424 Make these compile. 2003-01-21 11:31:38 +00:00
scw 980dea552e Add _UC_USER_BIT. 2003-01-21 11:30:52 +00:00
jdolecek 69371cb504 .Rv needs a function name as parameter 2003-01-21 03:33:30 +00:00
christos 3bcbc56f02 add manual pages. 2003-01-21 02:24:41 +00:00
scw 9566978c66 First cut of MD pthread glue for sh5. 2003-01-21 00:34:56 +00:00
christos 4e5f58dd38 more sem to _sem_st 2003-01-20 20:52:24 +00:00
christos 90135cf7e8 add support for p1003.1b semaphores. From FreeBSD 2003-01-20 20:10:19 +00:00
scw b896a7171e _{get,set,swap}context_u() for SH5. 2003-01-20 17:03:58 +00:00
matt 3afb199f73 Define FPREG macros even though we don't have any. 2003-01-20 01:49:36 +00:00
matt d36a12c9ca Add myself to the authors list. 2003-01-20 01:08:03 +00:00
matt fb891b41f5 Add _REG_foo to ppc mcontext and use them instead of constants. 2003-01-20 00:53:55 +00:00
matt aa6dda7b98 Need to define STACKSIZE (even though we don't need any). 2003-01-19 23:22:29 +00:00
matt 9eecca32ca Add of pthread support for VAX. 2003-01-19 23:20:14 +00:00
thorpej 7dc01dbfab Add some threadlib stubs that are used by X:
* thr_create() (stub in libc aborts)
* thr_exit() (stub in libc calls exit())
* thr_yield() (stub in libc does nothing)

Also make the libc thr_self() stub not abort.

XXX Should we add thrattr_*() stubs for setting the detach-state?
2003-01-19 21:58:21 +00:00
thorpej 096005bf70 Fix typo. 2003-01-19 21:42:09 +00:00
matt 561334ea93 Set _UC_USER in ucontext. Call setcontext if _UC_USER is not in
_setcontext_u
2003-01-19 21:31:42 +00:00
matt 696d424be5 VAX versions of _getcontext_u/_setcontext_u/_swapcontext_u 2003-01-19 21:01:55 +00:00
thorpej 9b29af3e07 Remove the dummy stack attr routines -- best to catch broken applications
and fix them to use the proper feature test instead (as has already been
done with the openldap package).
2003-01-19 20:58:00 +00:00
thorpej 592409d356 Add mutexattr_init(), mutexattr_destroy(), and mutexattr_settype() (recursive
mutexes are used by the X libraries).
2003-01-19 20:46:11 +00:00
thorpej 439830cb08 Always allow includes to be installed. This makes it easier for
people to get straggling ports bootstrapped (pthread.h is required
in order to build libc).
2003-01-19 19:55:13 +00:00
skrll 023fed95bf Move _POSIX_THREADS to the right place and define a few other symbolic
constants for the features we gained with the merge of the nathanw_sa
branch.

Ok'd by thorpej.

Closes my PR 19930.
2003-01-19 19:41:44 +00:00
wiz d44e858cbb Remove another variable name. 2003-01-19 19:21:49 +00:00
christos 1b36c15f8d - constify the get functions
- remove argument variable names since they pollute the namespace
- add mock implementation of the missing stack functions
XXX: we need to do this right [i.e. actually get and set sizes and addresses]
but the current stack setup makes this a bit complicated.
2003-01-19 16:03:50 +00:00
jdolecek 0b3f936d86 'destructor' is a bit too generic; use 'destruct' instead for
pthread_key_create() prototype
this fixes compilation of Python 2.2 with thread support
XXX perhaps should drop all variable names from prototypes?
2003-01-19 11:17:02 +00:00
christos 54ba9fedfe delint 2003-01-18 19:11:07 +00:00
christos 9631ace572 de-lint 2003-01-18 18:40:52 +00:00
christos 3823415af9 add missing backslash 2003-01-18 18:40:08 +00:00
thorpej c62a74e6d5 Merge the nathanw_sa branch. 2003-01-18 10:32:11 +00:00
scottr 35d33206a7 This incarnation of the pthreads library is ancient and not useful, and
should have been mothballed some time ago...
1997-10-08 17:17:10 +00:00
scottr a1d96607f3 This incarnation of the pthreads library is ancient and not useful, and
should have been mothballed some time ago...
1997-10-08 17:14:35 +00:00
christos d94d1f6795 Wow, call the function, don't just mention its name! 1997-10-08 04:14:40 +00:00
christos c36405f069 Don't cast things to u_quad_t, but to u_long. 1997-10-08 04:14:00 +00:00
christos 060951ae78 Cast functions to the proper signatures and avoid const clash. 1997-10-08 04:13:27 +00:00
christos 93bfa94d10 How did this ever work? Fix to pass fileno(fp), instead of fp to lseek.
Pass off_t instead of fpos_t as the second argument.
1997-10-08 04:12:34 +00:00
christos 8212c7a241 Avoid volatile warnings. 1997-10-08 04:11:16 +00:00
christos 5d7f9cdc6b Fix prototypes for flockfile and funlockfile to take a const FILE,
since they don't modify it.
1997-10-08 04:10:50 +00:00
christos ec75ec1f8c Make function declarations conform to the prototypes. 1997-10-08 00:52:47 +00:00
christos e57ffbac55 Fix declaration of sys_errlist, add prototypes for flockfile and funlockfile 1997-10-08 00:35:50 +00:00
christos eaa7838299 Add real prototypes 1997-10-08 00:33:40 +00:00
thorpej 7f9ea0f2ed Use ${INSTALL}. 1996-10-18 05:45:01 +00:00
cgd ae9172d6cd specify man pages the new way. 1994-12-22 09:57:51 +00:00
proven b1fc22f93a Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
proven 1c3caff3ff RCS ids added.
pthread_once() moved to separate file.
pthread_detach(), and pthread_join() routines added,
and sleep now sleeps only the running thread not the process.
1994-02-07 22:04:13 +00:00
proven 0ddc616639 RCS ids added.
pthread_once() defines moved to separate header file.
1994-02-07 22:02:26 +00:00
proven 21f4b3b04c More wrapper functions, and some hacks for machine independent sleep
mechanisms.
1994-02-07 22:00:44 +00:00
proven 772f07b4a8 The latest pthread library. 1994-02-07 21:59:27 +00:00
mycroft c48a79fee8 Stylistic change. 1994-01-27 06:50:06 +00:00
mycroft abeb62670e Delete special rules for syscall.S; they are not needed, and one of them
is wrong anyway.
1994-01-07 16:36:45 +00:00
proven 881ae40055 Copyrights added to each file. 1993-12-20 19:31:06 +00:00
mycroft add5cd71dc Clean up deleted files. 1993-12-20 19:30:59 +00:00
proven abe1bf3801 Copyrights added to each file. 1993-12-20 19:30:07 +00:00
proven bafb721fb3 Fix for older shells that can't handle then; 1993-11-22 19:37:48 +00:00
proven c88ef05a9a Added NOPIC flag. 1993-11-16 03:21:44 +00:00
cgd 93e4e1b5ae correct my bad advice 1993-11-15 11:11:00 +00:00
proven b410643359 Fixed mysteriouly disappearing SCCS ID. 1993-11-15 10:06:09 +00:00
proven e123d2840c OK one more try at getting it right ... 1993-11-15 10:02:18 +00:00
proven 2000519508 Makefile needed a preall to make a few links before compiling sources.
CVS doesn't check in symlinks.
1993-11-15 06:49:08 +00:00
proven 89fc7bac08 Initial release of the POSIX 1003.4a Draft 7 thread implementation. 1993-11-14 22:06:22 +00:00