summaryrefslogtreecommitdiff
path: root/locks/win32
Commit message (Collapse)AuthorAgeFilesLines
* Improve WIN32 condition variables fairness by using a generation count. The ↵Davi Arnaut2007-07-121-8/+25
| | | | | | | | | count assures that one thread won't steal wakeups from other threads in the queue. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@555730 13f79535-47bb-0310-9956-ffa450edef68
* Rework the win32 CV code to signal the condition only if one or more threadsDavi Arnaut2007-06-291-50/+73
| | | | | | | | | | | | | are blocked on the condition variable. If no threads are waiting on the condition variable, nothing happens. This patch also eliminates the thundering-herd problem of the manual-reset event, which (theoretically) wakes up all threads waiting on. Now the behavior of the CV's should be the same on Unix and win32 platforms. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@551965 13f79535-47bb-0310-9956-ffa450edef68
* apr_proc_mutex_child_init calls unimplemented OpenMutexW and will fail toWilliam A. Rowe Jr2007-06-011-0/+9
| | | | | | | | | | | | | | compile on Windows CE. The patch implements the expected behavior of OpenMutexW by calling CreateMutex (which will open an existing mutex or create one if it doesn't exist) and close the mutex and return an error unless CreateMutex indicated that the mutex already existed. PR: 39858 Submitted by: Curt Arnold <carnold apache.org> Reviewed by: Davi Arnaut git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@543333 13f79535-47bb-0310-9956-ffa450edef68
* Fix the typo.Joe Orton2006-08-034-4/+4
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@428317 13f79535-47bb-0310-9956-ffa450edef68
* Update license header.Joe Orton2006-08-034-24/+24
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@428313 13f79535-47bb-0310-9956-ffa450edef68
* Fix up Win32-private includes to bring it in line with all other platforms.Justin Erenkrantz2006-07-122-3/+3
| | | | | | | | | | Originally titled: [patch 10/17] include path prefix win32/ Submitted by: John Mark Vandenberg Reviewed by: Will Rowe (concept), Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@421349 13f79535-47bb-0310-9956-ffa450edef68
* Close a kernel layer segfault when the user attempts to lockWilliam A. Rowe Jr2006-03-181-1/+2
| | | | | | | | | | | a critical section after DeleteCriticalSection() has been invoked. There is no protection in the lock/unlock kernel code, so ensure we don't enter the critical section path at all with deleted mutex, and fail instead by attempting to wait on a bad handle, resulting in a less drastic failure. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@386780 13f79535-47bb-0310-9956-ffa450edef68
* Fix an assert that occurs when you destroy a rwlock on win32 and later clearGarrett Rooney2006-01-221-8/+10
| | | | | | | | | | | | | | | | | | | | the pool it was allocated from. Submitted by: Evgueni Brevnov <evgueni.brevnov gmail.com> * locks/win32/thread_rwlock.c (apr_thread_rwlock_destroy): Use apr_pool_cleanup_run to call our cleanup function. (thread_rwlock_cleanup): Put the destruction of the rwlock here instead of in the destructor function. * test/testlock.c (test_thread_rwlocks): Destroy the rwlock explicitly so we can see this kind of problem. * CHANGES: Note change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@371172 13f79535-47bb-0310-9956-ffa450edef68
* Win32: fix apr_proc_mutex_trylock() to handle WAIT_TIMEOUT,William A. Rowe Jr2005-09-211-0/+3
| | | | | | | | | | | returning APR_EBUSY. Submitted by: Ronen Mizrahi <ronen tversity.com> Reviewed by: wrowe, Henry Jen git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@290766 13f79535-47bb-0310-9956-ffa450edef68
* Refactor Win32 condition variables code to address bugs.William A. Rowe Jr2005-07-221-64/+19
| | | | | | | | | PR: 27654, 34336 Submitted by: Henry Jen <henryjen ztune.net> and E Holyat <eholyat yahoo.com> Reviewed by: wrowe, stoddard git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@224407 13f79535-47bb-0310-9956-ffa450edef68
* Update copyright year to 2005 and standardize on current copyright owner line.Justin Erenkrantz2005-02-044-4/+8
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@151412 13f79535-47bb-0310-9956-ffa450edef68
* Untabify source. Mladen Turk2005-01-101-2/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@124775 13f79535-47bb-0310-9956-ffa450edef68
* Add missing apr_proc_mutex_cleanup function call.Mladen Turk2005-01-101-2/+7
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@124774 13f79535-47bb-0310-9956-ffa450edef68
* Relicense APR under Apache License, Version 2.0Justin Erenkrantz2004-02-134-196/+40
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64904 13f79535-47bb-0310-9956-ffa450edef68
* Clean up a style issue; apr_get_os_error() is much cleaner.William A. Rowe Jr2003-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: https://svn.apache.org/repos/asf/apr/apr/trunk@64542 13f79535-47bb-0310-9956-ffa450edef68
* Win32: Adopt Brian Havard's OS/2 rwlock implementation.Bill Stoddard2003-06-181-41/+107
| | | | | | | | Submitted by: Marc Adkins Reviewed by: Bill Stoddard git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64541 13f79535-47bb-0310-9956-ffa450edef68
* Add proc_mutex_lockfile() for retrieving the name of the fileJeff Trawick2003-06-071-0/+5
| | | | | | | | | | | | 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: https://svn.apache.org/repos/asf/apr/apr/trunk@64531 13f79535-47bb-0310-9956-ffa450edef68
* Win32 needs to do nothing if the file handle is already open in a childWilliam A. Rowe Jr2003-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: https://svn.apache.org/repos/asf/apr/apr/trunk@64452 13f79535-47bb-0310-9956-ffa450edef68
* Fix two problems in apr_thread_cond_timedwait, the first observed byWilliam A. Rowe Jr2003-02-271-2/+3
| | | | | | | | | Ohtani Hiroki <ohtani@ariel-networks.com> that we failed to relock on failure, and the second problem I found that we weren't returning an error status when we failed for something other than timeup. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64389 13f79535-47bb-0310-9956-ffa450edef68
* Namespace protection for include/arch/ header filesThom May2003-01-064-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-014-4/+4
| | | | | | | No functional changes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64251 13f79535-47bb-0310-9956-ffa450edef68
* A second stab at getting apr_thread_cond_timedwait to work. SomeoneWilliam A. Rowe Jr2002-12-311-2/+2
| | | | | | | | | else should look at this code, please, and let me know if it follows the correct behavior. It passes the tests, but that presumes the tests themselves are sufficient. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64243 13f79535-47bb-0310-9956-ffa450edef68
* Fix up code in thread_cond. First always escape the case where we outrightWilliam A. Rowe Jr2002-12-291-23/+72
| | | | | | | | | | | | | fail a single WaitForSingleObject(..., INFINITE) (yes, it can happen) and properly unwind the *correct* error when we fail the nested Wait. Also clean up the usage where rv is an apr result, and res in an NT result to conform a bit better with other code. Finally implements thread_cond_wait_with_timeout. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64238 13f79535-47bb-0310-9956-ffa450edef68
* Handle leaks right now are a huge problem. Close two of them.William A. Rowe Jr2002-07-311-6/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63746 13f79535-47bb-0310-9956-ffa450edef68
* forewarnedWilliam A. Rowe Jr2002-07-151-1/+5
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63672 13f79535-47bb-0310-9956-ffa450edef68
* Added 2 additional lock functions: apr_proc_mutex_name andJim Jagielski2002-06-071-0/+10
| | | | | | | | | | | | | | | | | | | apr_proc_mutex_defname which returns the type name of the mutex (eg: "sysvsem") as well as the default mutex type (APR_LOCK_DEFAULT). Mostly useful under Unix were the locktypes are selectable. apr_proc_mutex_name takes a *apr_proc_mutex_t argument, whereas apr_proc_mutex_defname takes (and requires) none. For those systems that don't have selectable mutex types, I've "thought up" names that made sense... feel free to modify :) PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63470 13f79535-47bb-0310-9956-ffa450edef68
* Split APR_THREAD_MUTEX_DEFAULT with a new APR_THREAD_MUTEX_UNNESTEDWilliam A. Rowe Jr2002-05-291-12/+69
| | | | | | | | | | | | | | | | 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
* ** DEPRECATE old lock API: apr_lock.h **Aaron Bannert2002-04-091-303/+0
| | | | | | | | | | | 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
* Update our copyright for this year.Roy T. Fielding2002-03-135-5/+5
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63117 13f79535-47bb-0310-9956-ffa450edef68
* Fix a segfault in apr_thread_rwlock_destroy() on Win32. The poolJeff Trawick2002-03-121-0/+1
| | | | | | | | | | field in the lock was uninitialized. Submitted by: INOUE Seiichiro <inoue@ariel-networks.com> Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63107 13f79535-47bb-0310-9956-ffa450edef68
* Win32: Fix apr_proc_mutex_lock/trylock. Getting WAIT_ABANDONED isBill Stoddard2002-02-281-8/+2
| | | | | | | not a failure condition when calling WaitForSingleObject on a mutex. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63071 13f79535-47bb-0310-9956-ffa450edef68
* Unnamed cross proc locks are quite legal on win32, thank you.William A. Rowe Jr2002-02-271-4/+6
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63068 13f79535-47bb-0310-9956-ffa450edef68
* No actual global_mutex implementation on Win32, it's simply a proc_lock.William A. Rowe Jr2002-02-221-102/+0
| | | | | | | Same commit needed for Netware - though I don't that build structure. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63051 13f79535-47bb-0310-9956-ffa450edef68
* Implement apr_global_mutex_foo() on Windows. This is basically identicalBill Stoddard2002-02-191-7/+14
| | | | | | | to apr_proc_lock as a Windows MUTEX locks threads as well as processes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63026 13f79535-47bb-0310-9956-ffa450edef68
* get rid of a stray ';' after APR_IMPLEMENT_POOL_ACCESSOR()Jeff Trawick2002-02-181-1/+1
| | | | | | | | | | | | | | AIX xlc really got upset, though I didn't unravel the macro to see what the fuss was about > "global_mutex.c", line 177.42: 1506-137 (E) Declaration > must declare at least one declarator, tag, or the members > of an enumeration. I changed the other new invocations to match the normal pattern. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63024 13f79535-47bb-0310-9956-ffa450edef68
* Add a new lock API: apr_global_mutex_tAaron Bannert2002-02-181-0/+95
| | | | | | | | | | | 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
* We don't look for palloc to failWilliam A. Rowe Jr2002-02-161-3/+0
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62994 13f79535-47bb-0310-9956-ffa450edef68
* Win32 mod_rewrite was broken by the implicit assumption that fname wouldWilliam A. Rowe Jr2002-02-011-6/+29
| | | | | | | | | | | | have a value. Of course, fname may be NULL, in which case this patch from 1.46 broke any NULL locking. Correct the Local/Global fix for NULL lock names. Oh most excelent RM of .31, please consider this patch, without which mod_rewrite will not load. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62890 13f79535-47bb-0310-9956-ffa450edef68
* Fix thread_mutex trylock for Win9x (returns APR_ENOTIMPL) andWilliam A. Rowe Jr2002-01-082-14/+101
| | | | | | | introduce proc_mutex for Win32. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62714 13f79535-47bb-0310-9956-ffa450edef68
* roll the extra apr_lock_create_np() functionality into apr_lock_create()Jeff Trawick2001-12-292-8/+6
| | | | | | | | | | | and get rid of apr_lock_create_np(); apr_lock_create() has a new parameter for specifying the lock mechanism (or APR_LOCK_DEFAULT to let APR choose) (same for apr_proc_mutex_create_np() and apr_proc_mutex_create()) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62684 13f79535-47bb-0310-9956-ffa450edef68
* Fix compile error introduced by the previous commit to this file.Bill Stoddard2001-11-271-0/+1
| | | | | | | | Need to include misc.h to prevent undefined variable errors for apr_os_level and APR_WIN_2000. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62564 13f79535-47bb-0310-9956-ffa450edef68
* Fix locks for win32 terminal services, submitted by Mladen TurkWilliam A. Rowe Jr2001-11-271-2/+16
| | | | | | | | | | | <mturk@mappingsoft.com>. This is the cleaner of the two parts of his patch, which does _not_ change the initial locking state of the mutex, nor add a private owner flag. Those changes were invalid because no part of apr should rely on intimate knowledge of the internals of other parts of apr, whenever we can avoid it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62563 13f79535-47bb-0310-9956-ffa450edef68
* This one is serious - Win9x won't work till it's addressed.William A. Rowe Jr2001-11-271-0/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62561 13f79535-47bb-0310-9956-ffa450edef68
* Implement portable accessors for proc mutex. These are equivalent toAaron Bannert2001-10-191-0/+25
| | | | | | | | | | | apr_os_lock_get/set, but they work for apr_proc_mutex_t types instead. I did my best to implement these on non-Unix platforms from how I saw them implemented for apr_os_lock_get/set, but on those platforms they are untested. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62447 13f79535-47bb-0310-9956-ffa450edef68
* Added a new parameter to apr_thread_mutex_init(). Mutexes are now byAaron Bannert2001-10-171-0/+3
| | | | | | | | | | | | | | | | 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
* Adds apr_thread_cond_timedwait() interface to new lock API.Aaron Bannert2001-10-121-0/+6
| | | | | | | Implements it for UNIX, stubs elsewhere. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62419 13f79535-47bb-0310-9956-ffa450edef68
* Implement pool accessors for thread_condition variables.Ryan Bloom2001-09-291-0/+3
| | | | | | | Submitted by: Aaron Bannert <aaron@clove.org> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62385 13f79535-47bb-0310-9956-ffa450edef68
* Implement pool accessor for rwlocks.Ryan Bloom2001-09-291-0/+2
| | | | | | | Submitted by: Aaron Bannert <aaron@clove.org> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62384 13f79535-47bb-0310-9956-ffa450edef68
* Implement pool accessor functions for proc mutex'sRyan Bloom2001-09-291-0/+2
| | | | | | | Submitted by: Aaron Bannert <aaron@clove.org> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62383 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