summaryrefslogtreecommitdiff
path: root/locks/os2/thread_mutex.c
Commit message (Collapse)AuthorAgeFilesLines
* apr_{thread,proc,global}_timedlock() with negative timeout is now equivalentYann Ylavic2017-04-071-4/+1
| | | | | | | | | to apr_{thread,proc,global}_trylock(), i.e. immediate attempt to acquire the lock (but returning APR_TIMEUP if busy). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1790632 13f79535-47bb-0310-9956-ffa450edef68
* locks: follow up to r1790488.Yann Ylavic2017-04-071-1/+1
| | | | | | | | Make it clear in the type that it's a relative/interval time. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1790521 13f79535-47bb-0310-9956-ffa450edef68
* locks: follow up to r1667900.Yann Ylavic2017-04-071-20/+6
| | | | | | | | | | | | | Axe the 'absolute' argument of apr_{thread,proc,global}_mutex_timedlock() which was confusing, hence 'timeout' is always relative now. It still makes sense (to me) to handle a negative timeout as INFINITE, a nul one as IMMEDIATE, and a positive one as an upper bound timeout (like most if not all of the underlying system calls...). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1790488 13f79535-47bb-0310-9956-ffa450edef68
* OS/2: Fix compile breakage in apr_thread_mutex_timedlock() due to incorrect ↵Brian Havard2016-05-041-1/+1
| | | | | | variable name. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1742215 13f79535-47bb-0310-9956-ffa450edef68
* Follow up to r1667900: handle negative (infinite) timeout in mutex/cond ↵Yann Ylavic2015-03-201-11/+15
| | | | | | timedlock/timedwait. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1667962 13f79535-47bb-0310-9956-ffa450edef68
* locks: introduce apr_{thread,proc,global}_mutex_timedlock().Yann Ylavic2015-03-191-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For proc mutexes, the new mechanism APR_LOCK_DEFAULT_TIMED usable at creation time allows for the best mechanism to be elected (unixes: 1 to 3, or specific: 4 to 7): 1. PROC_PTHREAD if pthread_mutex_timedlock() and pthread_mutex_set_robust_np() are both available, 2. SYSV if semtimedop() is availale, 3. POSIXSEM if sem_timedwait() is available, 4. BeOS' acquire_sem_etc() if available, 5. NetWare falls back to apr_thread_mutex_timedlock() as for others functions, 6. OS2's DosRequestMutexSem(), 7. Windows' WaitForSingleObject(). Otherwise (like when fcntl and flock only are availble, if that's ever possible), APR_ENOTIMPL is returned. For thread mutexes, the new flag APR_THREAD_MUTEX_TIMED, usable at create() time still, allows to switch to an implementation using a condition variable and apr_thread_cond_timedwait() when if no native mechanism is available (eg. NetWare, pthreads but without pthread_mutex_timedlock() available). On windows, this initializes a WaitForSingleObject()able handle (Mutex) instead of the fastest (but not timeout-able) CRITICAL_SECTION used by default. All apr_{thread,proc,global}_mutex_timedlock() functions can take a relative or absolute time, thanks to the last (boolean) argument. Test suite updated accordingly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1667900 13f79535-47bb-0310-9956-ffa450edef68
* OS/2: Make apr_thread_mutex_trylock() return APR_EBUSY if lock cannot beBrian Havard2010-04-031-0/+5
| | | | | | | obtained instead of APR_FROM_OS_ERROR(ERROR_TIMEOUT). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@930504 13f79535-47bb-0310-9956-ffa450edef68
* OS/2: Remove all remaining uses of APR_OS2_STATUS macro which has beenBrian Havard2010-04-021-4/+4
| | | | | | | superceded by the more general APR_FROM_OS_ERROR. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@930224 13f79535-47bb-0310-9956-ffa450edef68
* Fix the typo.Joe Orton2006-08-031-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@428317 13f79535-47bb-0310-9956-ffa450edef68
* Update license header.Joe Orton2006-08-031-6/+6
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@428313 13f79535-47bb-0310-9956-ffa450edef68
* Update copyright year to 2005 and standardize on current copyright owner line.Justin Erenkrantz2005-02-041-1/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@151412 13f79535-47bb-0310-9956-ffa450edef68
* Relicense APR under Apache License, Version 2.0Justin Erenkrantz2004-02-131-49/+10
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64904 13f79535-47bb-0310-9956-ffa450edef68
* rename apr_arch_fileio.h to apr_arch_file_io.h for consistencyThom May2003-01-071-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64275 13f79535-47bb-0310-9956-ffa450edef68
* Namespace protection for include/arch/ header filesThom May2003-01-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | aix/dso.h -> -> aix/apr_arch_dso.h beos/dso.h -> beos/apr_arch_dso.h beos/proc_mutex.h -> beos/apr_arch_proc_mutex.h beos/thread_cond.h -> beos/apr_arch_thread_cond.h beos/thread_mutex.h -> beos/apr_arch_thread_mutex.h beos/threadproc.h -> beos/apr_arch_threadproc.h beos/thread_rwlock.h -> beos/apr_arch_thread_rwlock.h netware/dso.h -> -> netware/apr_arch_dso.h netware/fileio.h -> -> netware/apr_arch_fileio.h netware/global_mutex.h -> netware/apr_arch_global_mutex.h netware/internal_time.h -> netware/apr_arch_internal_time.h netware/networkio.h -> netware/apr_arch_networkio.h netware/pre_nw.h -> netware/apr_arch_pre_nw.h netware/proc_mutex.h -> netware/apr_arch_proc_mutex.h netware/thread_cond.h -> netware/apr_arch_thread_cond.h netware/thread_mutex.h -> netware/apr_arch_thread_mutex.h netware/threadproc.h -> netware/apr_arch_threadproc.h netware/thread_rwlock.h -> netware/apr_arch_thread_rwlock.h os2/dso.h -> os2/apr_arch_dso.h os2/fileio.h -> os2/apr_arch_fileio.h os2/networkio.h -> os2/apr_arch_networkio.h os2/os2calls.h -> os2/apr_arch_os2calls.h os2/proc_mutex.h -> os2/apr_arch_proc_mutex.h os2/thread_cond.h -> os2/apr_arch_thread_cond.h os2/thread_mutex.h -> os2/apr_arch_thread_mutex.h os2/threadproc.h -> os2/apr_arch_threadproc.h os2/thread_rwlock.h -> os2/apr_arch_thread_rwlock.h os390/dso.h -> os390/apr_arch_dso.h unix/dso.h -> unix/apr_arch_dso.h unix/fileio.h -> unix/apr_arch_fileio.h unix/global_mutex.h -> unix/apr_arch_global_mutex.h unix/inherit.h -> unix/apr_arch_inherit.h unix/internal_time.h -> unix/apr_arch_internal_time.h unix/misc.h -> unix/apr_arch_misc.h unix/networkio.h -> unix/apr_arch_networkio.h unix/proc_mutex.h -> unix/apr_arch_proc_mutex.h unix/shm.h -> unix/apr_arch_shm.h unix/thread_cond.h -> unix/apr_arch_thread_cond.h unix/thread_mutex.h -> unix/apr_arch_thread_mutex.h unix/threadproc.h -> unix/apr_arch_threadproc.h unix/thread_rwlock.h -> unix/apr_arch_thread_rwlock.h win32/atime.h -> win32/apr_arch_atime.h win32/dso.h -> win32/apr_arch_dso.h win32/fileio.h -> win32/apr_arch_fileio.h win32/inherit.h -> win32/apr_arch_inherit.h win32/misc.h -> win32/apr_arch_misc.h win32/networkio.h -> win32/apr_arch_networkio.h win32/proc_mutex.h -> win32/apr_arch_proc_mutex.h win32/thread_cond.h -> win32/apr_arch_thread_cond.h win32/thread_mutex.h -> win32/apr_arch_thread_mutex.h win32/threadproc.h -> win32/apr_arch_threadproc.h win32/thread_rwlock.h -> win32/apr_arch_thread_rwlock.h win32/utf8.h -> win32/apr_arch_utf8.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64271 13f79535-47bb-0310-9956-ffa450edef68
* Update copyright notices to 2003.Thom May2003-01-011-1/+1
| | | | | | | No functional changes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64251 13f79535-47bb-0310-9956-ffa450edef68
* Split APR_THREAD_MUTEX_DEFAULT with a new APR_THREAD_MUTEX_UNNESTEDWilliam A. Rowe Jr2002-05-291-0/+3
| | | | | | | | | | | | | | | | which guarentees unnested lock behavior, keep APR_THREAD_MUTEX_DEFAULT on Win32, Netware and OS2 as nested locks, leave Unix and BeOS with unnested locks by default. Needs an implementation on Netware and OS2 for UNNESTED locks, for now return APR_ENOTIMPL. Required for absolute locks in series for Win32 on the same thread, since CriticalSection objects are blindingly fast without contention, but they will always nest on the same thread. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63440 13f79535-47bb-0310-9956-ffa450edef68
* Update our copyright for this year.Roy T. Fielding2002-03-131-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63117 13f79535-47bb-0310-9956-ffa450edef68
* Remove FIXME comment. Yes, OS/2 native locks support nesting.Brian Havard2001-10-171-1/+0
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62436 13f79535-47bb-0310-9956-ffa450edef68
* Added a new parameter to apr_thread_mutex_init(). Mutexes are now byAaron Bannert2001-10-171-0/+2
| | | | | | | | | | | | | | | | default not nested, but an init flag can enable them. I added a new test to testlockperf to show how much faster non-nested mutexes are. I also updated calls to apr_thread_mutex_init() wherever I could find them. This patch only implements this for Unix (nested locks already existed on Unix, so this patch just optionally enables/disables them). I did my best to change the function declaration on other platforms, but someone will have to double check me. Those other platforms will also have to either enable nested locks (sometimes available in their thread library) or just do what Unix does. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62435 13f79535-47bb-0310-9956-ffa450edef68
* Add pool accessors to the apr_thread_mutex_t datatype.Ryan Bloom2001-09-261-0/+3
| | | | | | | Submitted by: Aaron Bannert <aaron@clove.org> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62377 13f79535-47bb-0310-9956-ffa450edef68
* OS/2: Implement apr_thread_mutex functions.Brian Havard2001-09-121-6/+51
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62315 13f79535-47bb-0310-9956-ffa450edef68
* Add the new thread_lock API to APR. This is the first step to breakingRyan Bloom2001-09-041-0/+88
the locking API into separate APIs. Submitted by: Aaron Bannert <aaron@clove.org> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62286 13f79535-47bb-0310-9956-ffa450edef68