summaryrefslogtreecommitdiff
path: root/include/apr_global_mutex.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove trailing whitespaces.Ivan Zhakov2022-11-191-2/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1905407 13f79535-47bb-0310-9956-ffa450edef68
* apr_{thread,proc,global}_timedlock() with negative timeout is now equivalentYann Ylavic2017-04-071-1/+3
| | | | | | | | | 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-4/+2
| | | | | | | | | | | | | 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
* apr_proc/global_mutex: Fix API regarding the native OS mutexesYann Ylavic2016-03-061-4/+12
| | | | | | | | | | | | | | | | | | | | | | | accessors from/to available APR mechanisms, adding the new functions apr_os_proc_mutex_get_ex() and apr_os_proc_mutex_set_ex() which give control to the user over the selected mechanisms, including the missing POSIX semaphores (sem_t) on platforms supporting them. For POSIX sems, this moves the "sem_t *psem_interproc;" member from struct apr_proc_mutex_t to apr_os_proc_mutex_t (now complete) so that we can avoid members duplication between the two structs, and hence replace all the doublons in apr_os_proc_mutex_t with an apr_os_proc_mutex_t member, called "os", to be used for runtime. This first commit aims to be backportable to 1.6.x, thus does not address the Netware case which requires an incompatible change of the apr_proc_mutex_t to a pointer type (the implementation is here since very similar to other changes is this commit, but it is commented out for now, a simple follow up is coming with the type change for trunk only...). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1733775 13f79535-47bb-0310-9956-ffa450edef68
* Follow up to r1667900: fix comments.Yann Ylavic2015-03-191-2/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1667903 13f79535-47bb-0310-9956-ffa450edef68
* locks: introduce apr_{thread,proc,global}_mutex_timedlock().Yann Ylavic2015-03-191-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* add apr_global_mutex_name(), for retrieving the name of the mechanismJeff Trawick2009-11-251-0/+9
| | | | | | | | | | used by the underlying apr_proc_mutex_t declare NULL as the result for any future mechanisms that don't have an underlying apr_proc_mutex_t or equivalent git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@884139 13f79535-47bb-0310-9956-ffa450edef68
* add missing apr_global_mutex_lockfile(), corresponding toJeff Trawick2009-11-211-0/+8
| | | | | | | apr_proc_mutex_lockfile() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@882915 13f79535-47bb-0310-9956-ffa450edef68
* Add object perms set macros and implement them for shm and mutexMladen Turk2009-02-071-0/+5
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@741862 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
* Rebalance our exposed headers such that everything is nested properlyWilliam A. Rowe Jr2003-03-051-8/+11
| | | | | | | | | | | | | | between extern "C" blocks and doxygen blocks, that we never include other headers within our own header's extern "C" block, that we always tag the entire file contents for doxygen (within the APR_HEADER_H only-once block), and generally clean up doxygen so that it is all consistent and generates respectable (although not yet 'great') results. Major TODO after 0.9.2 releases; fill in the apr.h APR_HAVE/APR_HAS and apr_type_t documentation!!! git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64397 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
* Go through doxygen output and remove as many errors and warnings as I could.Justin Erenkrantz2002-11-101-0/+1
| | | | | | | | | | | No code changes. (Note removal of #define duplication in apr_poll.h/apr_network_io.h of the APR_POLL* values. This appears to have been an oversight and is now just in apr_poll.h) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64009 13f79535-47bb-0310-9956-ffa450edef68
* ** DEPRECATE old lock API: apr_lock.h **Aaron Bannert2002-04-091-1/+1
| | | | | | | | | | | Resolve some circular includes (apr_thread_mutex.h needs apr_pools.h needs apr_allocator.h needs apr_thread_mutex.h ...). Remove all apr_lock.h related files (incl. arch-specific headers and implementations). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63234 13f79535-47bb-0310-9956-ffa450edef68
* Support for Posix semaphores for locking has been added. This usesJim Jagielski2002-04-041-0/+1
| | | | | | | | | | | | | | | | | | | | named semaphores (sem_open). Because there are a few different implementations around, this uses the lowest common denominator in creating the semaphore name. As far as its location in DEFAULT priority, it's placed between pthread and sysvsem. Tested on Darwin (in which it's the new default) and Solaris. As part of the discovery of sem_open under Solaris, APR is now aware of shm_open (Posix shared memory) under Solaris as well, if someone wants to monkey with that :) PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63222 13f79535-47bb-0310-9956-ffa450edef68
* update an old commentJeff Trawick2002-03-171-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63146 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
* Added the include of apr_proc_mutex.h if the global mutex is proc mutexBradley Nicholes2002-02-261-0/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63065 13f79535-47bb-0310-9956-ffa450edef68
* Per Aaron's consent that there is no more rational way to optimize thisWilliam A. Rowe Jr2002-02-221-0/+20
| | | | | | | | | | | relationship - allow Win32/Netware [and perhaps, some unix-ish platforms that don't have a 'proc lock not typesafe' construct] to 'borrow' the proc_mutex code. Because the apr_thread_lock_create call differs so significantly, global locks can never be implemented in terms of thread locks [as well as the converse.] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63050 13f79535-47bb-0310-9956-ffa450edef68
* Add a new lock API: apr_global_mutex_tAaron Bannert2002-02-181-0/+164
This is analog to the APR_LOCKALL method of apr_lock_t, and provides cross-process AND cross-thread mutual exclusion. I have provided a simple test (based on testprocmutex.c) and stubs for non-Unix platforms. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63001 13f79535-47bb-0310-9956-ffa450edef68