summaryrefslogtreecommitdiff
path: root/lib/libthr/thread/thr_cond.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix the wrapper function around signals so that a signal handlingMike Makonnen2003-12-091-9/+0
| | | | | | | | thread on one of the mutex or condition variable queues is removed from those queues before the real signal handler is called. Notes: svn path=/head/; revision=123350
* Catchup with _thread_suspend() changes.Mike Makonnen2003-06-301-1/+1
| | | | Notes: svn path=/head/; revision=117073
* I botched one of my committs in the last round. Fix it.Mike Makonnen2003-05-311-2/+3
| | | | Notes: svn path=/head/; revision=115442
* Use a static lock to ake sure pthread_cond_* functions calledMike Makonnen2003-05-291-2/+20
| | | | | | | | | | | | | | | from multiple threads don't initialze the same condition variable more than once. Explicitly compare cond pointers with PTHREAD_COND_INITIALIZER instead of NULL. Just because it happens to be defined as NULL is no reason to encourage the idea that people can call those functions with NULL pointers to a condition variable. Approved by: re/jhb Notes: svn path=/head/; revision=115389
* Lock the cond queue (condition variables):Mike Makonnen2003-05-241-70/+43
| | | | | | | | | | | | | | | | | | | Access to the thread's flags and state is protected by _thread_critical_enter/exit(). When a thread is signaled with a condition its state must be protected by locking it and disabling signals before it is taken of the waiters' queue. Move the implementation of pthread_cond_signal() and pthread_cond_broadcast() into one function, cond_signal(). Its behaviour is determined by the last argument, int broadcast. If this is set to 1 it will remove all waiters, otherwise it will wake up only the first waiter thread. Remove an extraneous call to pthread_testcancel(). Approved by: re/blanket libthr Notes: svn path=/head/; revision=115277
* Insert a debugging aid:Mike Makonnen2003-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 Notes: svn path=/head/; revision=115198
* Do some cleanup with respect to condition variables. The implementationMike Makonnen2003-05-151-15/+14
| | | | | | | | | | | | | | | of pthread_cond_timedwait() is moved into cond_wait_common(). Pthread_cond_wait() and pthread_cond_timedwait() are now wrappers around this function. Previously, the former called the latter with the abstime pointing to 0 time. This violated Posix semantics should an application have reason to call it with that argument because instead or returning immediately it would have waited indefinitely for the cv to be signaled. Approved by: markm/mentor, re/blanket libthr Reviewed by: jeff Notes: svn path=/head/; revision=115035
* - Define curthread as _get_curthread() and remove all direct calls toJeff Roberson2003-04-021-6/+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(). Notes: svn path=/head/; revision=112965
* - Don't drop and reacquire giant in thread_suspend(). Change callers to doJeff Roberson2003-04-011-0/+2
| | | | | | | | this manually. This will facilitate the unrolling of giant. - Don't allow giant to recurse anymore. This should never happen. Notes: svn path=/head/; revision=112960
* - Add libthr but don't hook it up to the regular build yet. This is anJeff Roberson2003-04-011-0/+544
adaptation of libc_r for the thr system call interface. This is beta quality code. Notes: svn path=/head/; revision=112918