summaryrefslogtreecommitdiffstats
path: root/lib/libthr/thread/thr_mutex.c
Commit message (Collapse)AuthorAgeFilesLines
* o Refactor and, among other things, get rid of insane nesting levels.mtm2004-02-181-810/+300
| | | | | | | o Fix mutex priority protocols. Keep separate counts of priority inheritance and protection mutexes to make things easier. This will not have much affect since this is only the userland side, and the rest involves kernel scheduling.
* Refactor _pthread_mutex_initmtm2004-01-191-125/+64
| | | | | | | | | | | | o Simplify the logic by removing a lot of unnecesary nesting o Reduce the amount of local variables o Zero-out the allocated structure and get rid of all the unnecessary setting to 0 and NULL; Refactor _pthread_mutex_destroy o Simplify the logic by removing a lot of unnecesary nesting o No need to check pointer that the mutex attributes points to. Checking passed in pointer is enough.
* o Implement pthread_mutex_timedlock(), which does not block indefinitely onmtm2003-12-301-0/+32
| | | | | a mutex locked by another thread. o document it: pthread_mutex_timedlock(3)
* Make it possible for the library to specify a timeout value whenmtm2003-12-301-20/+47
| | | | | | | | | | waiting on a locked mutex. This involves passing a struct timespec from the pthread mutex locking interfaces all the way down to the function that suspends the thread until the mutex is released. The timeout is assumed to be an absolute time (i.e. not relative to the current time). Also, in _thread_suspend() make the passed in timespec const.
* Fix the wrapper function around signals so that a signal handlingmtm2003-12-091-25/+1
| | | | | thread on one of the mutex or condition variable queues is removed from those queues before the real signal handler is called.
* Change all instances of THR_LOCK/UNLOCK, etc to UMTX_*.mtm2003-07-061-2/+2
| | | | | It is a more acurate description of the locks they operate on.
* _pthread_mutex_trylock() is another internal libc function that must blockmtm2003-07-031-0/+8
| | | | signals.
* Begin making libthr async signal safe.mtm2003-07-021-2/+22
| | | | | | | | Create a private, single underscore, version of pthread_mutex_unlock for libc. pthread_mutex_lock already has one. These versions are different from the ones that applications will link against because they block all signals from the time a call to lock the mutex is made until it is successfully unlocked.
* Do not attempt to reque a thread on a mutex queue. It may be thatmtm2003-07-011-1/+1
| | | | | | | | | a thread receives a spurious wakeup from sigtimedwait(), so make sure that the call to the queueing code is called only once before entering the loop (not in the loop). This should fix some fatal errors people are seeing with messages stating the thread is already on the mutex queue. These errors may still be triggered from signal handlers; however, since that part of the code is not locked down yet.
* Catchup with _thread_suspend() changes.mtm2003-06-301-1/+5
|
* Sweep through pthread locking and use the new locking primitives formtm2003-06-291-2/+2
| | | | libthr.
* Consolidate static_init() and static_init_private into one function.mtm2003-06-021-17/+11
| | | | The behaviour of this function is controlled by the argument: private.
* I botched one of my committs in the last round. Fix it.mtm2003-05-311-10/+8
|
* Make the mutex static initializers look more like the one formtm2003-05-291-25/+19
| | | | | | | | | condition variables. Cosmetic. Explicitly compare against PTHREAD_MUTEX_INITIALIZER. We shouldn't encourage calls to the mutex functions with null pointers to mutexes. Approved by: re/jhb
* Make WARNS2 clean. The fixes mostly included:mtm2003-05-231-2/+4
| | | | | | | | o removed unused variables o explicit inclusion of header files o prototypes for externally defined functions Approved by: re/blanket libthr
* Insert a debugging aid:mtm2003-05-211-1/+9
| | | | | | | | When in either the mutex or cond queue we notice that the thread is already on one of the queues, don't just simply abort(). Print out the thread's identifiers and what queue it was on. Approved by: markm/mentor, re/blanket libthr
* msg1mtm2003-05-121-263/+129
|
* o Correct a debug message that refered to the wrong functionmtm2003-05-061-1/+1
| | | | | | | o Remove an unncecesary if clause Approved by: markm (mentor)(implicit) Reviewd by: jeff
* - Define curthread as _get_curthread() and remove all direct calls tojeff2003-04-021-8/+5
| | | | | | | _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().
* - Restore old mutex code from libc_r. It is more standards compliant.jeff2003-04-011-199/+1328
| | | | | | | This was changed because originally we were blocking on the umtx and allowing the kernel to do the queueing. It was decided that the lib should queue and start the threads in the order it decides and the umtx code would just be used like spinlocks.
* - Add libthr but don't hook it up to the regular build yet. This is anjeff2003-04-011-0/+432
adaptation of libc_r for the thr system call interface. This is beta quality code.
OpenPOWER on IntegriCloud