summaryrefslogtreecommitdiffstats
path: root/lib/libthr/thread/thr_stack.c
Commit message (Collapse)AuthorAgeFilesLines
* Decouple the thread stack [de]allocating functions from the 'dead threads list'mtm2003-05-261-4/+4
| | | | | | | lock. It's not really necessary and we don't need the added complexity or potential for deadlocks. Approved by: re/blanket libthr
* Start locking up the active and dead threads lists. The active threadsmtm2003-05-251-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* - Add libthr but don't hook it up to the regular build yet. This is anjeff2003-04-011-0/+240
adaptation of libc_r for the thr system call interface. This is beta quality code.
OpenPOWER on IntegriCloud