summaryrefslogtreecommitdiffstats
path: root/lib/libthr/thread/thr_spinlock.c
Commit message (Collapse)AuthorAgeFilesLines
* Avoid various shadowed variables. libthr is now almost WARNS=4 clean exceptdelphij2008-04-231-6/+6
| | | | | | for some const dequalifiers that needs more careful investigation. Ok'ed by: davidxu
* Remove 3rd clause, renumber, ok per emailimp2007-01-121-4/+1
|
* Replace internal usage of struct umtx with umutex which can supportsdavidxu2006-09-061-11/+18
| | | | real-time if we want, no functionality is changed.
* WARNS level 4 cleanup.davidxu2006-04-041-4/+5
|
* Increase the number of spinlocks, since libc's malloc implementation isjasone2006-01-131-1/+1
| | | | | | about to significantly increase the number of spinlocks used. Approved by: markm (mentor)
* Import my recent 1:1 threading working. some features improved includes:davidxu2005-04-021-109/+59
| | | | | | | | | | | | | | | | 1. fast simple type mutex. 2. __thread tls works. 3. asynchronous cancellation works ( using signal ). 4. thread synchronization is fully based on umtx, mainly, condition variable and other synchronization objects were rewritten by using umtx directly. those objects can be shared between processes via shared memory, it has to change ABI which does not happen yet. 5. default stack size is increased to 1M on 32 bits platform, 2M for 64 bits platform. As the result, some mysql super-smack benchmarks show performance is improved massivly. Okayed by: jeff, mtm, rwatson, scottl
* Unconditionaly initialize any spin lock passed to pthread_spin_init(). Whilemtm2004-04-241-4/+0
| | | | | | makeing sure the spinlock isn't already in use might be a nice feature to have in theory, it's hard to implement in practice since the passed in pointer may not be NULL, but still be an invalid value (i.e. 1..2..3.. etc).
* o Implement the pthread_spin_* functions in libthr.mtm2004-01-221-0/+86
| | | | o Man pages
* Fix the wrapper function around signals so that a signal handlingmtm2003-12-091-0/+11
| | | | | thread on one of the mutex or condition variable queues is removed from those queues before the real signal handler is called.
* There's no need for _umtxtrylock to be a separate function.mtm2003-07-061-10/+0
| | | | Roll it into the pre-existing macro that's used to call it.
* Locking primitives and operations in libthr should use struct umtx,mtm2003-06-291-2/+2
| | | | | | | | | | | not spinlock_t. Spinlock_t and the associated functions and macros may require blocking signals in order for async-safe libc functions to behave appropriately in libthr. This is undesriable for libthr internal locking. So, this is the first step in completely separating libthr from libc's locking primitives. Three new macros should be used for internal libthr locking from now on: THR_LOCK, THR_TRYLOCK, THR_UNLOCK.
* The move to _retire() a thread in the GC instead of in the thread'smtm2003-06-291-15/+3
| | | | | | | exit function has invalidated the need for _spin[un]lock_pthread(). The _spin[un]lock() functions can now dereference curthread without the danger that the ldtentry containing the pointer to the thread has been cleared out from under them.
* _pthread_cancel() breaks the normal lock order of first locking themtm2003-05-251-0/+10
| | | | | | | | | | | | | joined and then the joiner thread. There isn't an easy (sane?) way to make it use the correct order without introducing races involving the target thread and finding which (active or dead) list it is on. So, after locking the canceled thread it will try to lock the joined thread and if it fails release the first lock and try again from the top. Introduce a new function, _spintrylock, which is simply a wrapper arround umtx_trylock(), to help accomplish this. Approved by: re/blanket libthr
* Add two functions: _spinlock_pthread() and _spinunlock_pthread()mtm2003-05-231-2/+14
| | | | | | | | | | that take the address of a struct pthread as their first argument. _spin[un]lock() just become wrappers arround these two functions. These new functions are for use in situations where curthread can't be used. One example is _thread_retire(), where we invalidate the array index curthread uses to get its pointer.. Approved by: re/blanket libthr
* - Define curthread as _get_curthread() and remove all direct calls tojeff2003-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().
* - Add libthr but don't hook it up to the regular build yet. This is anjeff2003-04-011-0/+88
adaptation of libc_r for the thr system call interface. This is beta quality code.
OpenPOWER on IntegriCloud