summaryrefslogtreecommitdiffstats
path: root/lib/libthr/thread/thr_join.c
Commit message (Collapse)AuthorAgeFilesLines
* Change all instances of THR_LOCK/UNLOCK, etc to UMTX_*.mtm2003-07-061-6/+6
| | | | | It is a more acurate description of the locks they operate on.
* Catchup with _thread_suspend() changes.mtm2003-06-301-1/+3
|
* Sweep through pthread locking and use the new locking primitives formtm2003-06-291-6/+7
| | | | libthr.
* Don't hold the active thread list lock when signaling the gc thread.mtm2003-05-291-1/+1
| | | | | | | | | The dead list thread is sufficient for synchronization. Retire the arch_id (ldt array slot) in the gc thread instead of the doing it in the thread itself. Approved by: re/jhb
* Revert part of the last commit. I don't know what I was smoking.mtm2003-05-271-2/+13
| | | | Approved by: re/rwatson
* Revise the unlock order in _pthread_join(). Also, if the joinedmtm2003-05-261-12/+6
| | | | | | | | thread is not dead, the join loop is guaranteed to execute at least once, so there is no need to pick up the thread list lock after we return from suspenstion only to release it after the loop. Approved by: re/blanket libthr
* Start locking up the active and dead threads lists. The active threadsmtm2003-05-251-27/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | list is protected by a spinlock_t, but the dead list uses a pthread_mutex because it is necessary to synchronize other threads with the garbage collector thread. Lock/Unlock macros are used so it's easier to make changes to the locks in the future. The 'dead thread list' lock is intended to replace the gc mutex. This doesn't have any practical ramifications. It simply makes it clearer what the purpose of the lock is. The gc will use this lock, instead of the gc mutex, to synchronize access to the dead list with other threads. Modify _pthread_exit() to use these two new locks instead of GIANT_LOCK, and also to properly lock and protect thread state changes, especially with respect to a joining thread. The gc thread was also re-arranged to be more organized and less nested. _pthread_join() was also modified to use the thread list locks. However, locking and unlocking here needs special care because a thread could find itself in a position where it's joining an exiting thread that is waiting on the dead list lock, which this thread (joiner) holds. If the joiner doesn't take care to lock *and* unlock in the same order they (the joiner and the joinee) could deadlock against each other. Approved by: re/blanket libthr
* Move a misplaced comment.mtm2003-05-201-1/+1
| | | | Approved by: markm/mentor (implicit), re/blanket libthr
* - Define curthread as _get_curthread() and remove all direct calls tojeff2003-04-021-1/+0
| | | | | | | _get_curthread(). This is similar to the kernel's curthread. Doing this saves stack overhead and is more convenient to the programmer. - Pass the pointer to the newly created thread to _thread_init(). - Remove _get_curthread_slow().
* - Don't drop and reacquire giant in thread_suspend(). Change callers to dojeff2003-04-011-0/+2
| | | | | this manually. This will facilitate the unrolling of giant. - Don't allow giant to recurse anymore. This should never happen.
* - Add libthr but don't hook it up to the regular build yet. This is anjeff2003-04-011-0/+161
adaptation of libc_r for the thr system call interface. This is beta quality code.
OpenPOWER on IntegriCloud