summaryrefslogtreecommitdiff
path: root/locks
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright year to 2005 and standardize on current copyright owner line.jerenkrantz2005-02-0421-21/+42
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@151412 13f79535-47bb-0310-9956-ffa450edef68
* * locks/unix/proc_mutex.c (proc_mutex_posix_create): Drop unnecessaryjorton2005-01-131-3/+3
| | | | | | | casts. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@125073 13f79535-47bb-0310-9956-ffa450edef68
* Untabify source. mturk2005-01-101-2/+2
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@124775 13f79535-47bb-0310-9956-ffa450edef68
* Add missing apr_proc_mutex_cleanup function call.mturk2005-01-101-2/+7
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@124774 13f79535-47bb-0310-9956-ffa450edef68
* Fixing various compiler errors when compiling against the latest version of ↵bnicholes2004-11-271-1/+1
| | | | | | LibC SDK git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@106767 13f79535-47bb-0310-9956-ffa450edef68
* Remove .cvsignore files.jorton2004-11-183-13/+0
| | | | | | | Tipped-of-by: Uwe Zeisberger git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@76269 13f79535-47bb-0310-9956-ffa450edef68
* * locks/unix/proc_mutex.c (apr_proc_mutex_lockfile): Fix build onjorton2004-06-151-2/+8
| | | | | | | platforms without flock. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65200 13f79535-47bb-0310-9956-ffa450edef68
* * locks/unix/proc_mutex.c (apr_proc_mutex_create): Remove redundantjorton2004-06-141-7/+2
| | | | | | | NULL-initialization of zero-initialized field; remove redundant cast. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65194 13f79535-47bb-0310-9956-ffa450edef68
* * locks/unix/proc_mutex.c (proc_mutex_fcntl_cleanup): Always close thejorton2004-06-141-5/+2
| | | | | | | | file. (proc_mutex_fcntl_create): Don't call _cleanup on file open failure. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65193 13f79535-47bb-0310-9956-ffa450edef68
* * locks/unix/proc_mutex.c (proc_mutex_posix_release): Revert previousjorton2004-06-141-1/+3
| | | | | | | change, move ->curr_locked manipulation back inside critical section. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65192 13f79535-47bb-0310-9956-ffa450edef68
* * locks/unix/proc_mutex.c (apr_proc_mutex_lockfile): Avoid unnecessaryjorton2004-06-141-5/+4
| | | | | | | strcmp calls. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65191 13f79535-47bb-0310-9956-ffa450edef68
* * locks/unix/proc_mutex.c (proc_mutex_proc_pthread_cleanup): Fixjorton2004-06-141-1/+18
| | | | | | | | | | resource leak: destroy the mutex here, if it was ever initialized. (proc_mutex_proc_pthread_create): Destroy the mutexattr object on error paths; ensure that _cleanup destroys the mutex on error paths iff necessary. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65190 13f79535-47bb-0310-9956-ffa450edef68
* * locks/unix/proc_mutex.c (proc_mutex_proc_pthread_cleanup): Fixjorton2004-06-141-4/+4
| | | | | | | | | | memory leakup; always unmap the mmap'ed region. PR: 24049 Submitted by: Kohn Emil Dan <emild cs.technion.ac.il> git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65189 13f79535-47bb-0310-9956-ffa450edef68
* * locks/unix/proc_mutex.c (proc_mutex_pthread_create): Don't leak anjorton2004-06-141-0/+1
| | | | | | | fd on mmap failure. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65188 13f79535-47bb-0310-9956-ffa450edef68
* * locks/unix/proc_mutex.c (proc_mutex_posix_cleanup): Ignorejorton2004-06-141-19/+9
| | | | | | | | | | | | interproc->filedes, always close the semaphore. (proc_mutex_posix_create): Don't call cleanup if sem_open failed, don't set interproc->filedes to -1. (proc_mutex_posix_acquire): Simplify error handling. (proc_mutex_posix_release): Simplify. Only clear curr_locked flag on success. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65187 13f79535-47bb-0310-9956-ffa450edef68
* Support POSIX semaphores on LP64 platforms:jorton2004-06-141-4/+4
| | | | | | | | | | | | | | | | * configure.in: Don't disable POSIX semaphore support on LP64 platforms. * include/arch/unix/apr_arch_proc_mutex.h (struct apr_proc_mutex_t): Add a sem_t pointer field. * locks/unix/proc_mutex.c (proc_mutex_posix_create, proc_mutex_posix_cleanup, proc_mutex_posix_acquire, prox_mutex_posix_release): Use the sem_t pointer not the fd for the semaphore. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65185 13f79535-47bb-0310-9956-ffa450edef68
* * include/arch/unix/apr_arch_proc_mutex.h, locks/unix/proc_mutex.c:jorton2004-06-051-15/+15
| | | | | | | Don't define global symbols for the _methods structures. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65165 13f79535-47bb-0310-9956-ffa450edef68
* * locks/unix/proc_mutex.c (proc_mutex_no_child_init): Use single noopjorton2004-06-051-51/+15
| | | | | | | | | _child_init function. (proc_mutex_posix_setup, proc_mutex_proc_pthread_setup, proc_mutex_flock_setup): Remove empty functions. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65163 13f79535-47bb-0310-9956-ffa450edef68
* * locks/unix/proc_mutex.c (proc_mutex_flock_child_init): If open()jorton2004-06-051-1/+0
| | | | | | | fails in a child, the lock file should not be unlink()ed. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65162 13f79535-47bb-0310-9956-ffa450edef68
* Drop racy/broken Unix nested mutex implementation; use SUSv3-stylejorton2004-06-041-109/+36
| | | | | | | | | | | | | | | | | | | recursive mutex support if available: * build/apr_threads.m4 (APR_CHECK_PTHREAD_RECURSIVE_MUTEX): New macro. * configure.in: Use it. * include/arch/unix/apr_arch_thread_mutex.h (struct apr_thread_mutex_t): Drop nested mutex tracking fields. * locks/unix/thread_mutex.c (apr_thread_mutex_create): Return ENOTIMPL if lacking recursive mutex support, else create a recursive mutex. (apr_thread_mutex_lock, apr_thread_mutex_unlock, apr_thread_mutex_trylock): Remove nested mutex tracking. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65157 13f79535-47bb-0310-9956-ffa450edef68
* Add the apr_proc_mutex_cleanup function.dreid2004-03-091-0/+6
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64950 13f79535-47bb-0310-9956-ffa450edef68
* Cold but clear here today.dreid2004-02-261-0/+1
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64920 13f79535-47bb-0310-9956-ffa450edef68
* Fix some include paths for the new build systemdreid2004-02-264-5/+5
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64919 13f79535-47bb-0310-9956-ffa450edef68
* Relicense APR under Apache License, Version 2.0jerenkrantz2004-02-1321-1029/+210
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64904 13f79535-47bb-0310-9956-ffa450edef68
* First whack at switching to a single top-level make. This adds a dependencygstein2004-02-053-53/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | upon Python at packaging time, but not at end-user config/build time. As far as I can tell, the build continues to function properly. (out-of-dir config/make not tested, and apr-iconv prolly needs some work) The buildconf scripts now generate a build-outputs.mk file which is included by the root's Makefile (via the build/gen-build.py script). bulid-outputs.mk specifies all of the various files present in the distribution. The top-level Makefiles were simplified to use an $(OBJECTS) symbol rather than 'find'ing them. Similarly, a $(HEADERS) symbol is used for the exports. The corresponding delete-* targets were eliminated since we have a precise set of inputs. The subdirs' Makefiles were removed since they are no longer called/used. The apr-util/uri Makefile was responsible for compiling a C program to generate the uri_delims.h file. That process was replaced by a Python script to generate the header (called by buildconf). The .c and .dsp were left for the Windows build to continue, but that should be revamped. build/apr_rules.mk was revamped somewhat to avoid recursion, but a lot of cleanup is still needed. Much of the recursive/local/x- logic is no longer needed and can be elimianated. rules.mk was created for inclusion by N makefiles, but that isn't really true any more, so it could probably be tossed (caveat: test/Makefile). Saved for a phase 2. Some additional work was added to properly clean up files in */build/, rather than relying on a makefile in there. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64891 13f79535-47bb-0310-9956-ffa450edef68
* * configure.in: Fix detection of pthread rwlocks to actually fail whenjorton2004-01-261-4/+4
| | | | | | | | | | | | | pthread_rwlock_t can't be used; print and cache results of tests carried out; define HAVE_PTHREAD_RWLOCKS when rwlocks can be used. * locks/unix/thread_rwlock.c, include/arch/unix/apr_arch_thread_rwlock.h: Use new HAVE_PTHREAD_RWLOCKS define. PR: 22990 git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64882 13f79535-47bb-0310-9956-ffa450edef68
* * include/apr_thread_cond.h: Note when destroying a condvar givesjorton2003-12-291-7/+1
| | | | | | | | | | | | | | | undefined results in a POSIX implementation. * locks/unix/thread_cond.c (apr_thread_cond_create): Don't run cleanup if pthread_cond_init fails since that gives undefined results. (apr_thread_cond_destroy): Use apr_pool_cleanup_run so the cleanup is always unregistered. * test/testlock.c (test_cond): Test apr_thread_cond_destroy and use apr_assert_success() a little more. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64848 13f79535-47bb-0310-9956-ffa450edef68
* * include/arch/unix/apr_arch_thread_cond.h: Store a pthread_cond_tjorton2003-12-291-18/+7
| | | | | | | | | | | | object in struct apr_thread_cond_t rather than a pointer to one. * locks/unix/thread_cond.c (apr_thread_cond_create): Adjust use of ->cond, remove ENOMEM handling. (apr_thread_cond_wait, apr_thread_cond_timedwait, apr_thread_cond_signal, apr_thread_cond_broadcast): Adjust use of ->cond. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64847 13f79535-47bb-0310-9956-ffa450edef68
* thread id is not always a scalartrawick2003-11-161-1/+3
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64749 13f79535-47bb-0310-9956-ffa450edef68
* axing deprecated apr_atomic_foo functionstrawick2003-11-161-5/+5
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64747 13f79535-47bb-0310-9956-ffa450edef68
* ripjwoolley2003-11-161-5/+0
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64746 13f79535-47bb-0310-9956-ffa450edef68
* * include/arch/unix/apr_arch_thread_rwlock.h: Store a pthread_rwlock_tjorton2003-10-041-20/+8
| | | | | | | | | | | | | object in struct apr_thread_rwlock_t rather than a pointer to one. * locks/unix/thread_rwlock.c (apr_thread_rwlock_create): Adjust use of ->rwlock, simplify to a single palloc call, and remove ENOMEM handling. (apr_thread_rwlock_rdlock, apr_thread_rwlock_tryrdlock, apr_thread_rwlock_wrlock, apr_thread_rwlock_trywrlock, apr_thread_rwlock_unlock): Adjust use of ->rwlock appropriately. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64681 13f79535-47bb-0310-9956-ffa450edef68
* * locks/unix/thread_rwlock.c (apr_thread_rwlock_destroy): Simplifyjorton2003-10-031-3/+1
| | | | | | | to use apr_pool_cleanup_run. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64680 13f79535-47bb-0310-9956-ffa450edef68
* To produce results which are defined by POSIX, at time of cleanup thejorton2003-10-031-7/+4
| | | | | | | | | | | | | | rwlock must be initialized but not locked by any thread. Accordingly, remove code which POSIX says gives undefined results: * locks/unix/thread_rwlock.c (thread_rwlock_cleanup): Don't unlock an unlocked lock. (apr_thread_rwlock_create): Don't destroy an uninitialized lock if _init fails. (apr_thread_rwlock_destroy): If cleanup fails, the lock must be in a bad state, so don't run cleanup again. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64679 13f79535-47bb-0310-9956-ffa450edef68
* Thanks to Jeff for pointing out I didn't point to the atomics.wrowe2003-08-081-3/+3
| | | | | | | Fixes build breakage. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64581 13f79535-47bb-0310-9956-ffa450edef68
* Revamp apr_thread_mutex to be as thread safe, and occasionallywrowe2003-08-071-23/+57
| | | | | | | | | | | | | as reentrant as possible. Switched to atomics to preserve the incr/decr integrity. Although we previously reset the thread_id to zero, it's been pointed out on list that this is less than desireable. However, negative one isn't necessarily a good choice because several platforms have unsigned thread_t's. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64579 13f79535-47bb-0310-9956-ffa450edef68
* Introduce the proc_mutex_no_tryacquire stub, returning APR_ENOTIMPL,wrowe2003-08-061-5/+9
| | | | | | | | | | | | for all unimplemented trylock vectors. Prevents us from simply segfaulting when a given proc_mutex style does not support trylock. No Apache HTTP Server code attempted an apr_proc_mutex_trylock, but this could affect other platforms, and was inconsistent with the implementations of other mutex methods and other platform implementations. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64578 13f79535-47bb-0310-9956-ffa450edef68
* Invert the order of marking the lock as released. Since we firstwrowe2003-08-061-5/+5
| | | | | | | | | | | | | lock, then mark locked; instead mark as unlock (while the lock is still held) and then unlock. Serious change, this will mean that an unlock 'failure' will still set the unlocked flag. This is consistent with the fact that the lock probably is not held or valid anymore, and certainly shouldn't be re-unlocked when destroyed. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64577 13f79535-47bb-0310-9956-ffa450edef68
* Clean up a style issue; apr_get_os_error() is much cleaner.wrowe2003-06-181-13/+13
| | | | | | | | | Note that the result from WaitFor{*}() calls is a rather special case, since it has other interesting details. These were not touched since they are clearer as-is. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64542 13f79535-47bb-0310-9956-ffa450edef68
* Win32: Adopt Brian Havard's OS/2 rwlock implementation.stoddard2003-06-181-41/+107
| | | | | | | | Submitted by: Marc Adkins Reviewed by: Bill Stoddard git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64541 13f79535-47bb-0310-9956-ffa450edef68
* Error handling fix (unrelated to previous changes): don't calljorton2003-06-081-1/+0
| | | | | | | pthread_mutex_destroy(NULL) if pthread_mutex_init() fails. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64534 13f79535-47bb-0310-9956-ffa450edef68
* Code style cleanups: remove unnecessary casts to and from void *;jorton2003-06-081-8/+3
| | | | | | | don't check for allocation failure. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64533 13f79535-47bb-0310-9956-ffa450edef68
* POSIX says that passing a mutexattr object with default attributes tojorton2003-06-081-18/+1
| | | | | | | | | | | pthread_mutex_init() is equivalent to passing NULL: simplify apr_thread_mutex_create() to do the latter. Fixes build on BSD/OS 4.0, which prototypes but does not implement pthread_mutexattr_{init,destroy}, fooling the autoconf checks. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64532 13f79535-47bb-0310-9956-ffa450edef68
* Add proc_mutex_lockfile() for retrieving the name of the filetrawick2003-06-075-0/+32
| | | | | | | | | | | | associated with a mutex. This is used in Apache to simplify the effort of getting permissions set properly on mutexes that will be created as root but used as non-root. For flock-based mutexes, chown() needs to be performed on the mutex file. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64531 13f79535-47bb-0310-9956-ffa450edef68
* Don't require the lock file name to be passed intotrawick2003-06-071-0/+3
| | | | | | | | | | apr_proc_mutex_child_init() or apr_global_mutex_child_init(). This allows child init to work when the lock file was a temp file created by APR. (The problem only occurred with flock- based mutexes.) git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64530 13f79535-47bb-0310-9956-ffa450edef68
* When using a temporary file for flock- and fcntl-based mutexes,trawick2003-06-071-7/+4
| | | | | | | | | | | | | | don't let the file be deleted on close. For flock-based mutexes, this corrects a fatal problem, since the file would disappear when a program was spawned and cleanup-for-exec was performed, and a subsequent attempt to perform child process mutex initialization would fail. For fcntl-based mutexes, this was a very minor issue that resulted in a failing unlink() when the file was closed, since fcntl lock initialization always removes the file immediately. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64529 13f79535-47bb-0310-9956-ffa450edef68
* Don't segfault trying to close a file in error paths of flocktrawick2003-04-191-3/+6
| | | | | | | | | and fcntl mutex creation. PR: 19036 git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64488 13f79535-47bb-0310-9956-ffa450edef68
* We need to call apr_proc_mutex_child_init, whichjim2003-03-301-1/+4
| | | | | | | is not a noop for some mutexes git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64456 13f79535-47bb-0310-9956-ffa450edef68
* Bugz 17186jim2003-03-271-0/+1
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64453 13f79535-47bb-0310-9956-ffa450edef68
* Win32 needs to do nothing if the file handle is already open in a childwrowe2003-03-271-18/+51
| | | | | | | | | | | | | | | | | | process, and we are using anonymous proc_mutex or global_mutex methods, so win32 should return APR_SUCCESS for proc_mutex_child_init. We also introduced the kernel 'object' folding function for shared memory section names, so reuse that folding function here to provide reliable Win2K/XP names (prefixed with \global\) and fold away any slashes or backslashes from that path. Based on issues observed by "Andre Schild" <A.Schild@aarboard.ch> with the httpd mod_ssl implementation for Win32, with input from Andre and JimJ. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64452 13f79535-47bb-0310-9956-ffa450edef68