You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by wr...@apache.org on 2017/05/24 15:21:43 UTC
svn commit: r1796072 - in /apr/apr/branches/1.6.x: ./ include/
include/arch/netware/ include/arch/os2/ include/arch/unix/ locks/beos/
locks/netware/ locks/os2/ locks/unix/ locks/win32/ test/
Author: wrowe
Date: Wed May 24 15:21:43 2017
New Revision: 1796072
URL: http://svn.apache.org/viewvc?rev=1796072&view=rev
Log:
Revert 1733684 (r930508, r1667900, r1667901, r1667903, r1667962, r1669077, r1671292, r1732582 from trunk), was;
locks: introduce apr_{thread,proc,global}_mutex_timedlock().
(and many many more commit log entries, see r1733684 for details)
Modified:
apr/apr/branches/1.6.x/ (props changed)
apr/apr/branches/1.6.x/configure.in
apr/apr/branches/1.6.x/include/apr_global_mutex.h
apr/apr/branches/1.6.x/include/apr_proc_mutex.h
apr/apr/branches/1.6.x/include/apr_thread_mutex.h
apr/apr/branches/1.6.x/include/apr_time.h
apr/apr/branches/1.6.x/include/arch/netware/apr_arch_thread_mutex.h
apr/apr/branches/1.6.x/include/arch/os2/apr_arch_thread_cond.h
apr/apr/branches/1.6.x/include/arch/unix/apr_arch_proc_mutex.h
apr/apr/branches/1.6.x/include/arch/unix/apr_arch_thread_mutex.h
apr/apr/branches/1.6.x/locks/beos/proc_mutex.c
apr/apr/branches/1.6.x/locks/beos/thread_cond.c
apr/apr/branches/1.6.x/locks/beos/thread_mutex.c
apr/apr/branches/1.6.x/locks/netware/proc_mutex.c
apr/apr/branches/1.6.x/locks/netware/thread_cond.c
apr/apr/branches/1.6.x/locks/netware/thread_mutex.c
apr/apr/branches/1.6.x/locks/os2/proc_mutex.c
apr/apr/branches/1.6.x/locks/os2/thread_cond.c
apr/apr/branches/1.6.x/locks/os2/thread_mutex.c
apr/apr/branches/1.6.x/locks/unix/global_mutex.c
apr/apr/branches/1.6.x/locks/unix/proc_mutex.c
apr/apr/branches/1.6.x/locks/unix/thread_cond.c
apr/apr/branches/1.6.x/locks/unix/thread_mutex.c
apr/apr/branches/1.6.x/locks/win32/proc_mutex.c
apr/apr/branches/1.6.x/locks/win32/thread_cond.c
apr/apr/branches/1.6.x/locks/win32/thread_mutex.c
apr/apr/branches/1.6.x/test/testglobalmutex.c
apr/apr/branches/1.6.x/test/testlock.c
apr/apr/branches/1.6.x/test/testlockperf.c
apr/apr/branches/1.6.x/test/testmutexscope.c
apr/apr/branches/1.6.x/test/testprocmutex.c
Propchange: apr/apr/branches/1.6.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed May 24 15:21:43 2017
@@ -1,4 +1,4 @@
/apr/apr/branches/1.4.x:1003369,1101301
-/apr/apr/trunk:733052,739635,741862,741866-741867,741869,741871,745763-745764,746310,747990,748080,748361,748371,748565,748888,748902,748988,749810,760443,767895,775683,782838,783398,783958,784633,784773,788588,789050,793192-793193,794118,794485,795267,799497,800627,809745,809854,810472,811455,813063,821306,829490,831641,832904,835607,888669,892028,892159,892435,892909,896382,896653,899905,901088,902077,902090,908427,910419,910597,917819,917837-917838,923311,923320,925965,929796,930508,931973,932585,951771,960665,960671,979891,983618,989450,990435,1003338,1044440,1044447,1055657,1072165,1078845,1081462,1081495,1083038,1083242,1084662,1086695,1088023,1089031,1089129,1089438,1099348,1103310,1183683,1183685-1183686,1183688,1183693,1183698,1213382,1235047,1236970,1237078,1237507,1240472,1340286,1340288,1340470,1341193,1341196,1343233,1343243,1367050,1368819,1370494,1372018,1372022,1372093,1372849,1376957,1384764,1389077,1400200,1402868,1405985,1406690,1420106,1420109,1425356,1428809,143
8940,1438957-1438959,1442903,1449568,1456418,1459994,1460179-1460180,1460241,1460399,1460405,1462738,1462813,1470186,1470348,1475509,1478905,1480067,1481262,1481265,1484271,1487796,1489517,1496407,1502804,1510354,1516261,1523384,1523479,1523484,1523505,1523521,1523604,1523613,1523615,1523844-1523845,1523853,1524014,1524031,1528797,1528809,1529488,1529495,1529515,1529521,1529668,1530786,1530800,1530988,1531554,1531768,1531884,1532022,1533104,1533111,1533979,1535027,1535157,1536744,1538171,1539374,1539389,1539455,1539603,1541054,1541061,1541486,1541655,1541666,1541744,1542601,1542779,1543033,1543056,1548575,1550907,1551650,1551659,1558905,1559382,1559873,1559975,1561040,1561260,1561265,1561321,1561347,1561356,1561361,1561394,1561555,1571894,1575509,1578420,1587045,1587063,1587543,1587545,1588878,1588937,1589982,1593611,1593614-1593615,1593680,1594684,1594708,1595549,1597797,1597803,1604590,1604596,1604598,1605104,1610854,1611023,1611107,1611110,1611117,1611120,1611125,1611184,1611193,
1611466,1611515,1611517,1625173,1626564,1634615,1642159,1648830,1664406,1664447,1664451,1664471,1664769-1664770,1664775,1664904,1664911,1664958,1666341,1666411,1666458,1666611,1667420-1667421,1667423,1667900-1667901,1667903,1667914-1667916,1667962,1669077,1671292,1671329,1671356,1671386,1671389,1671513-1671514,1671957,1672354,1672366,1672495,1672575,1675644,1675656,1675668,1676013,1685929,1696140,1696767,1722547,1722557,1726928,1727020,1727160,1727175,1727199,1728957,1732582,1733451,1733594,1733694,1733706,1733708,1733775,1734816,1736552,1738791,1738925,1750374,1755709,1755740,1755746,1755758,1755954,1762326,1774712,1776994,1776998,1788334,1788337,1789947,1789998,1790200,1791598
+/apr/apr/trunk:733052,739635,741862,741866-741867,741869,741871,745763-745764,746310,747990,748080,748361,748371,748565,748888,748902,748988,749810,760443,767895,775683,782838,783398,783958,784633,784773,788588,789050,793192-793193,794118,794485,795267,799497,800627,809745,809854,810472,811455,813063,821306,829490,831641,832904,835607,888669,892028,892159,892435,892909,896382,896653,899905,901088,902077,902090,908427,910419,910597,917819,917837-917838,923311,923320,925965,929796,931973,932585,951771,960665,960671,979891,983618,989450,990435,1003338,1044440,1044447,1055657,1072165,1078845,1081462,1081495,1083038,1083242,1084662,1086695,1088023,1089031,1089129,1089438,1099348,1103310,1183683,1183685-1183686,1183688,1183693,1183698,1213382,1235047,1236970,1237078,1237507,1240472,1340286,1340288,1340470,1341193,1341196,1343233,1343243,1367050,1368819,1370494,1372018,1372022,1372093,1372849,1376957,1384764,1389077,1400200,1402868,1405985,1406690,1420106,1420109,1425356,1428809,1438940,14
38957-1438959,1442903,1449568,1456418,1459994,1460179-1460180,1460241,1460399,1460405,1462738,1462813,1470186,1470348,1475509,1478905,1480067,1481262,1481265,1484271,1487796,1489517,1496407,1502804,1510354,1516261,1523384,1523479,1523484,1523505,1523521,1523604,1523613,1523615,1523844-1523845,1523853,1524014,1524031,1528797,1528809,1529488,1529495,1529515,1529521,1529668,1530786,1530800,1530988,1531554,1531768,1531884,1532022,1533104,1533111,1533979,1535027,1535157,1536744,1538171,1539374,1539389,1539455,1539603,1541054,1541061,1541486,1541655,1541666,1541744,1542601,1542779,1543033,1543056,1548575,1550907,1551650,1551659,1558905,1559382,1559873,1559975,1561040,1561260,1561265,1561321,1561347,1561356,1561361,1561394,1561555,1571894,1575509,1578420,1587045,1587063,1587543,1587545,1588878,1588937,1589982,1593611,1593614-1593615,1593680,1594684,1594708,1595549,1597797,1597803,1604590,1604596,1604598,1605104,1610854,1611023,1611107,1611110,1611117,1611120,1611125,1611184,1611193,1611466
,1611515,1611517,1625173,1626564,1634615,1642159,1648830,1664406,1664447,1664451,1664471,1664769-1664770,1664775,1664904,1664911,1664958,1666341,1666411,1666458,1666611,1667420-1667421,1667423,1667914-1667916,1671329,1671356,1671386,1671389,1671513-1671514,1671957,1672354,1672366,1672495,1672575,1675644,1675656,1675668,1676013,1685929,1696140,1696767,1722547,1722557,1726928,1727020,1727160,1727175,1727199,1728957,1733451,1733594,1733694,1733706,1733708,1733775,1734816,1736552,1738791,1738925,1750374,1755709,1755740,1755746,1755758,1755954,1762326,1774712,1776994,1776998,1788334,1788337,1789947,1789998,1790200,1791598
/apr/apr/trunk/test/testnames.c:1460405
/httpd/httpd/trunk:1604590
Modified: apr/apr/branches/1.6.x/configure.in
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/configure.in?rev=1796072&r1=1796071&r2=1796072&view=diff
==============================================================================
--- apr/apr/branches/1.6.x/configure.in (original)
+++ apr/apr/branches/1.6.x/configure.in Wed May 24 15:21:43 2017
@@ -2176,17 +2176,10 @@ AC_SUBST(struct_rlimit)
dnl ----------------------------- Checking for Locking Characteristics
echo "${nl}Checking for Locking..."
-AC_CHECK_FUNCS(semget semctl semop semtimedop flock)
-APR_IFALLYES(func:semtimedop, have_semtimedop="1", have_semtimedop="0")
-
-AC_CHECK_HEADERS(semaphore.h)
+AC_CHECK_FUNCS(semget semctl flock)
+AC_CHECK_HEADERS(semaphore.h OS.h)
AC_SEARCH_LIBS(sem_open, rt)
-AC_CHECK_FUNCS(sem_close sem_unlink sem_post sem_wait sem_timedwait)
-APR_IFALLYES(func:sem_timedwait, have_sem_timedwait="1", have_sem_timedwait="0")
-
-AC_CHECK_HEADERS(OS.h)
-AC_CHECK_FUNCS(create_sem acquire_sem acquire_sem_etc)
-APR_IFALLYES(header:OS.h func:acquire_sem_etc, have_acquire_sem_etc="1", have_acquire_sem_etc="0")
+AC_CHECK_FUNCS(sem_close sem_unlink sem_post sem_wait create_sem)
# Some systems return ENOSYS from sem_open.
AC_CACHE_CHECK(for working sem_open,ac_cv_func_sem_open,[
@@ -2245,10 +2238,7 @@ APR_CHECK_DEFINE_FILES(POLLIN, poll.h sy
if test "$threads" = "1"; then
APR_CHECK_DEFINE(PTHREAD_PROCESS_SHARED, pthread.h)
- AC_CHECK_FUNCS(pthread_mutex_timedlock pthread_mutexattr_setpshared)
- APR_IFALLYES(header:pthread.h func:pthread_mutex_timedlock,
- have_pthread_mutex_timedlock="1", have_pthread_mutex_timedlock="0")
- AC_SUBST(have_pthread_mutex_timedlock)
+ AC_CHECK_FUNCS(pthread_mutexattr_setpshared)
# Some systems have setpshared and define PROCESS_SHARED, but don't
# really support PROCESS_SHARED locks. So, we must validate that we
# can go through the steps without receiving some sort of system error.
@@ -2286,8 +2276,8 @@ fi
APR_IFALLYES(header:semaphore.h func:sem_open func:sem_close dnl
func:sem_unlink func:sem_post func:sem_wait,
hasposixser="1", hasposixser="0")
-APR_IFALLYES(func:semget func:semctl func:semop define:SEM_UNDO,
- hassysvser="1", hassysvser="0")
+APR_IFALLYES(func:semget func:semctl define:SEM_UNDO, hassysvser="1",
+ hassysvser="0")
APR_IFALLYES(func:flock define:LOCK_EX, hasflockser="1", hasflockser="0")
APR_IFALLYES(header:fcntl.h define:F_SETLK, hasfcntlser="1", hasfcntlser="0")
# note: the current APR use of shared mutex requires /dev/zero
@@ -2312,9 +2302,9 @@ APR_IFALLYES(func:flock define:LOCK_EX,
APR_DECIDE(USE_FLOCK_SERIALIZE, [4.2BSD-style flock()]))
APR_IFALLYES(header:fcntl.h define:F_SETLK,
APR_DECIDE(USE_FCNTL_SERIALIZE, [SVR4-style fcntl()]))
-APR_IFALLYES(func:semget func:semctl func:semop define:SEM_UNDO,
+APR_IFALLYES(func:semget func:semctl define:SEM_UNDO,
APR_DECIDE(USE_SYSVSEM_SERIALIZE, [SysV IPC semget()]))
-APR_IFALLYES(header:OS.h func:create_sem func:acquire_sem func:acquire_sem_etc,
+APR_IFALLYES(header:OS.h func:create_sem,
APR_DECIDE(USE_BEOSSEM, [BeOS Semaphores]))
if test "x$apr_lock_method" != "x"; then
APR_DECISION_FORCE($apr_lock_method)
Modified: apr/apr/branches/1.6.x/include/apr_global_mutex.h
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/include/apr_global_mutex.h?rev=1796072&r1=1796071&r2=1796072&view=diff
==============================================================================
--- apr/apr/branches/1.6.x/include/apr_global_mutex.h (original)
+++ apr/apr/branches/1.6.x/include/apr_global_mutex.h Wed May 24 15:21:43 2017
@@ -29,7 +29,6 @@
#if APR_PROC_MUTEX_IS_GLOBAL
#include "apr_proc_mutex.h"
#endif
-#include "apr_time.h"
#ifdef __cplusplus
extern "C" {
@@ -67,7 +66,6 @@ typedef struct apr_global_mutex_t apr_gl
* APR_LOCK_POSIXSEM
* APR_LOCK_PROC_PTHREAD
* APR_LOCK_DEFAULT pick the default mechanism for the platform
- * APR_LOCK_DEFAULT_TIMED pick the default timed mechanism
* </PRE>
* @param pool the pool from which to allocate the mutex.
* @warning Check APR_HAS_foo_SERIALIZE defines to see if the platform supports
@@ -111,17 +109,6 @@ APR_DECLARE(apr_status_t) apr_global_mut
APR_DECLARE(apr_status_t) apr_global_mutex_trylock(apr_global_mutex_t *mutex);
/**
- * Attempt to acquire the lock for the given mutex until timeout expires.
- * If the acquisition time outs, the call returns with APR_TIMEUP.
- * @param mutex the mutex on which to attempt the lock acquiring.
- * @param timeout the absolute time or relative timeout (microseconds)
- * @param absolute whether the timeout given is absolute (!0) or relative (0)
- */
-APR_DECLARE(apr_status_t) apr_global_mutex_timedlock(apr_global_mutex_t *mutex,
- apr_time_t timeout,
- int absolute);
-
-/**
* Release the lock for the given mutex.
* @param mutex the mutex from which to release the lock.
*/
Modified: apr/apr/branches/1.6.x/include/apr_proc_mutex.h
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/include/apr_proc_mutex.h?rev=1796072&r1=1796071&r2=1796072&view=diff
==============================================================================
--- apr/apr/branches/1.6.x/include/apr_proc_mutex.h (original)
+++ apr/apr/branches/1.6.x/include/apr_proc_mutex.h Wed May 24 15:21:43 2017
@@ -26,7 +26,6 @@
#include "apr_pools.h"
#include "apr_errno.h"
#include "apr_perms_set.h"
-#include "apr_time.h"
#ifdef __cplusplus
extern "C" {
@@ -49,8 +48,7 @@ typedef enum {
APR_LOCK_SYSVSEM, /**< System V Semaphores */
APR_LOCK_PROC_PTHREAD, /**< POSIX pthread process-based locking */
APR_LOCK_POSIXSEM, /**< POSIX semaphore process-based locking */
- APR_LOCK_DEFAULT, /**< Use the default process lock */
- APR_LOCK_DEFAULT_TIMED /**< Use the default process timed lock */
+ APR_LOCK_DEFAULT /**< Use the default process lock */
} apr_lockmech_e;
/** Opaque structure representing a process mutex. */
@@ -116,17 +114,6 @@ APR_DECLARE(apr_status_t) apr_proc_mutex
APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex);
/**
- * Attempt to acquire the lock for the given mutex until timeout expires.
- * If the acquisition time outs, the call returns with APR_TIMEUP.
- * @param mutex the mutex on which to attempt the lock acquiring.
- * @param timeout the absolute time or relative timeout (microseconds)
- * @param absolute whether the timeout given is absolute (!0) or relative (0)
- */
-APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex,
- apr_time_t timeout,
- int absolute);
-
-/**
* Release the lock for the given mutex.
* @param mutex the mutex from which to release the lock.
*/
Modified: apr/apr/branches/1.6.x/include/apr_thread_mutex.h
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/include/apr_thread_mutex.h?rev=1796072&r1=1796071&r2=1796072&view=diff
==============================================================================
--- apr/apr/branches/1.6.x/include/apr_thread_mutex.h (original)
+++ apr/apr/branches/1.6.x/include/apr_thread_mutex.h Wed May 24 15:21:43 2017
@@ -43,11 +43,9 @@ typedef struct apr_thread_mutex_t apr_th
#define APR_THREAD_MUTEX_DEFAULT 0x0 /**< platform-optimal lock behavior */
#define APR_THREAD_MUTEX_NESTED 0x1 /**< enable nested (recursive) locks */
#define APR_THREAD_MUTEX_UNNESTED 0x2 /**< disable nested locks */
-#define APR_THREAD_MUTEX_TIMED 0x4 /**< enable timed locks */
/* Delayed the include to avoid a circular reference */
#include "apr_pools.h"
-#include "apr_time.h"
/**
* Create and initialize a mutex that can be used to synchronize threads.
@@ -84,17 +82,6 @@ APR_DECLARE(apr_status_t) apr_thread_mut
APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex);
/**
- * Attempt to acquire the lock for the given mutex until timeout expires.
- * If the acquisition time outs, the call returns with APR_TIMEUP.
- * @param mutex the mutex on which to attempt the lock acquiring.
- * @param timeout the absolute time or relative timeout (microseconds)
- * @param absolute whether the timeout given is absolute (!0) or relative (0)
- */
-APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex,
- apr_time_t timeout,
- int absolute);
-
-/**
* Release the lock for the given mutex.
* @param mutex the mutex from which to release the lock.
*/
Modified: apr/apr/branches/1.6.x/include/apr_time.h
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/include/apr_time.h?rev=1796072&r1=1796071&r2=1796072&view=diff
==============================================================================
--- apr/apr/branches/1.6.x/include/apr_time.h (original)
+++ apr/apr/branches/1.6.x/include/apr_time.h Wed May 24 15:21:43 2017
@@ -23,6 +23,7 @@
*/
#include "apr.h"
+#include "apr_pools.h"
#include "apr_errno.h"
#ifdef __cplusplus
@@ -119,9 +120,6 @@ struct apr_time_exp_t {
apr_int32_t tm_gmtoff;
};
-/* Delayed the include to avoid a circular reference */
-#include "apr_pools.h"
-
/**
* Convert an ansi time_t to an apr_time_t
* @param result the resulting apr_time_t
Modified: apr/apr/branches/1.6.x/include/arch/netware/apr_arch_thread_mutex.h
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/include/arch/netware/apr_arch_thread_mutex.h?rev=1796072&r1=1796071&r2=1796072&view=diff
==============================================================================
--- apr/apr/branches/1.6.x/include/arch/netware/apr_arch_thread_mutex.h (original)
+++ apr/apr/branches/1.6.x/include/arch/netware/apr_arch_thread_mutex.h Wed May 24 15:21:43 2017
@@ -18,14 +18,11 @@
#define THREAD_MUTEX_H
#include "apr_thread_mutex.h"
-#include "apr_thread_cond.h"
#include <nks/synch.h>
struct apr_thread_mutex_t {
apr_pool_t *pool;
NXMutex_t *mutex;
- apr_thread_cond_t *cond;
- int locked, num_waiters;
};
#endif /* THREAD_MUTEX_H */
Modified: apr/apr/branches/1.6.x/include/arch/os2/apr_arch_thread_cond.h
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/include/arch/os2/apr_arch_thread_cond.h?rev=1796072&r1=1796071&r2=1796072&view=diff
==============================================================================
--- apr/apr/branches/1.6.x/include/arch/os2/apr_arch_thread_cond.h (original)
+++ apr/apr/branches/1.6.x/include/arch/os2/apr_arch_thread_cond.h Wed May 24 15:21:43 2017
@@ -22,11 +22,6 @@
struct apr_thread_cond_t {
apr_pool_t *pool;
- HEV semaphore;
- HMTX mutex;
- unsigned long num_waiting;
- unsigned long num_wake;
- unsigned long generation;
};
#endif /* THREAD_COND_H */
Modified: apr/apr/branches/1.6.x/include/arch/unix/apr_arch_proc_mutex.h
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/include/arch/unix/apr_arch_proc_mutex.h?rev=1796072&r1=1796071&r2=1796072&view=diff
==============================================================================
--- apr/apr/branches/1.6.x/include/arch/unix/apr_arch_proc_mutex.h (original)
+++ apr/apr/branches/1.6.x/include/arch/unix/apr_arch_proc_mutex.h Wed May 24 15:21:43 2017
@@ -26,7 +26,6 @@
#include "apr_portable.h"
#include "apr_file_io.h"
#include "apr_arch_file_io.h"
-#include "apr_time.h"
/* System headers required by Locks library */
#if APR_HAVE_SYS_TYPES_H
@@ -70,7 +69,6 @@ struct apr_proc_mutex_unix_lock_methods_
apr_status_t (*create)(apr_proc_mutex_t *, const char *);
apr_status_t (*acquire)(apr_proc_mutex_t *);
apr_status_t (*tryacquire)(apr_proc_mutex_t *);
- apr_status_t (*timedacquire)(apr_proc_mutex_t *, apr_time_t, int);
apr_status_t (*release)(apr_proc_mutex_t *);
apr_status_t (*cleanup)(void *);
apr_status_t (*child_init)(apr_proc_mutex_t **, apr_pool_t *, const char *);
Modified: apr/apr/branches/1.6.x/include/arch/unix/apr_arch_thread_mutex.h
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/include/arch/unix/apr_arch_thread_mutex.h?rev=1796072&r1=1796071&r2=1796072&view=diff
==============================================================================
--- apr/apr/branches/1.6.x/include/arch/unix/apr_arch_thread_mutex.h (original)
+++ apr/apr/branches/1.6.x/include/arch/unix/apr_arch_thread_mutex.h Wed May 24 15:21:43 2017
@@ -21,7 +21,6 @@
#include "apr_private.h"
#include "apr_general.h"
#include "apr_thread_mutex.h"
-#include "apr_thread_cond.h"
#include "apr_portable.h"
#include "apr_atomic.h"
@@ -33,8 +32,6 @@
struct apr_thread_mutex_t {
apr_pool_t *pool;
pthread_mutex_t mutex;
- apr_thread_cond_t *cond;
- int locked, num_waiters;
};
#endif
Modified: apr/apr/branches/1.6.x/locks/beos/proc_mutex.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/locks/beos/proc_mutex.c?rev=1796072&r1=1796071&r2=1796072&view=diff
==============================================================================
--- apr/apr/branches/1.6.x/locks/beos/proc_mutex.c (original)
+++ apr/apr/branches/1.6.x/locks/beos/proc_mutex.c Wed May 24 15:21:43 2017
@@ -27,13 +27,13 @@ static apr_status_t _proc_mutex_cleanup(
apr_proc_mutex_t *lock = (apr_proc_mutex_t*)data;
if (lock->LockCount != 0) {
/* we're still locked... */
- while (atomic_add(&lock->LockCount , -1) > 1){
- /* OK we had more than one person waiting on the lock so
- * the sem is also locked. Release it until we have no more
- * locks left.
- */
+ while (atomic_add(&lock->LockCount , -1) > 1){
+ /* OK we had more than one person waiting on the lock so
+ * the sem is also locked. Release it until we have no more
+ * locks left.
+ */
release_sem (lock->Lock);
- }
+ }
}
delete_sem(lock->Lock);
return APR_SUCCESS;
@@ -47,7 +47,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex
apr_proc_mutex_t *new;
apr_status_t stat = APR_SUCCESS;
- if (mech != APR_LOCK_DEFAULT && mech != APR_LOCK_DEFAULT_TIMED) {
+ if (mech != APR_LOCK_DEFAULT) {
return APR_ENOTIMPL;
}
@@ -82,77 +82,25 @@ APR_DECLARE(apr_status_t) apr_proc_mutex
{
int32 stat;
- if (atomic_add(&mutex->LockCount, 1) > 0) {
- if ((stat = acquire_sem(mutex->Lock)) < B_NO_ERROR) {
- atomic_add(&mutex->LockCount, -1);
- return stat;
- }
- }
+ if (atomic_add(&mutex->LockCount, 1) > 0) {
+ if ((stat = acquire_sem(mutex->Lock)) < B_NO_ERROR) {
+ atomic_add(&mutex->LockCount, -1);
+ return stat;
+ }
+ }
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex)
{
- int32 stat;
-
- if (atomic_add(&mutex->LockCount, 1) > 0) {
- stat = acquire_sem_etc(mutex->Lock, 1, 0, 0);
- if (stat < B_NO_ERROR) {
- atomic_add(&mutex->LockCount, -1);
- if (stat == B_WOULD_BLOCK) {
- stat = APR_EBUSY;
- }
- return stat;
- }
- }
- return APR_SUCCESS;
-}
-
-APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex,
- apr_time_t timeout,
- int absolute)
-{
- int32 stat;
-
- if (atomic_add(&mutex->LockCount, 1) > 0) {
- if (timeout < 0) {
- stat = acquire_sem(mutex->Lock);
- }
- else {
- int flag = 0;
- if (timeout > 0) {
- if (absolute) {
- apr_time_t now = apr_time_now();
- if (timeout > now) {
- timeout -= now;
- }
- else {
- timeout = 0;
- }
- flag = B_ABSOLUTE_TIMEOUT;
- }
- else {
- flag = B_RELATIVE_TIMEOUT;
- }
- }
- stat = acquire_sem_etc(mutex->Lock, 1, flag, timeout);
- }
- if (stat < B_NO_ERROR) {
- atomic_add(&mutex->LockCount, -1);
- if (stat == B_TIMED_OUT) {
- stat = APR_TIMEUP;
- }
- return stat;
- }
- }
- return APR_SUCCESS;
+ return APR_ENOTIMPL;
}
APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex)
{
int32 stat;
- if (atomic_add(&mutex->LockCount, -1) > 1) {
+ if (atomic_add(&mutex->LockCount, -1) > 1) {
if ((stat = release_sem(mutex->Lock)) < B_NO_ERROR) {
atomic_add(&mutex->LockCount, 1);
return stat;
Modified: apr/apr/branches/1.6.x/locks/beos/thread_cond.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/locks/beos/thread_cond.c?rev=1796072&r1=1796071&r2=1796072&view=diff
==============================================================================
--- apr/apr/branches/1.6.x/locks/beos/thread_cond.c (original)
+++ apr/apr/branches/1.6.x/locks/beos/thread_cond.c Wed May 24 15:21:43 2017
@@ -81,7 +81,7 @@ APR_DECLARE(apr_status_t) apr_thread_con
static apr_status_t do_wait(apr_thread_cond_t *cond, apr_thread_mutex_t *mutex,
- apr_interval_time_t timeout)
+ int timeout)
{
struct waiter_t *wait;
thread_id cth = find_thread(NULL);
Modified: apr/apr/branches/1.6.x/locks/beos/thread_mutex.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/locks/beos/thread_mutex.c?rev=1796072&r1=1796071&r2=1796072&view=diff
==============================================================================
--- apr/apr/branches/1.6.x/locks/beos/thread_mutex.c (original)
+++ apr/apr/branches/1.6.x/locks/beos/thread_mutex.c Wed May 24 15:21:43 2017
@@ -27,13 +27,13 @@ static apr_status_t _thread_mutex_cleanu
apr_thread_mutex_t *lock = (apr_thread_mutex_t*)data;
if (lock->LockCount != 0) {
/* we're still locked... */
- while (atomic_add(&lock->LockCount , -1) > 1){
- /* OK we had more than one person waiting on the lock so
- * the sem is also locked. Release it until we have no more
- * locks left.
- */
+ while (atomic_add(&lock->LockCount , -1) > 1){
+ /* OK we had more than one person waiting on the lock so
+ * the sem is also locked. Release it until we have no more
+ * locks left.
+ */
release_sem (lock->Lock);
- }
+ }
}
delete_sem(lock->Lock);
return APR_SUCCESS;
@@ -91,13 +91,13 @@ APR_DECLARE(apr_status_t) apr_thread_mut
return APR_SUCCESS;
}
- if (atomic_add(&mutex->LockCount, 1) > 0) {
- if ((stat = acquire_sem(mutex->Lock)) < B_NO_ERROR) {
+ if (atomic_add(&mutex->LockCount, 1) > 0) {
+ if ((stat = acquire_sem(mutex->Lock)) < B_NO_ERROR) {
/* Oh dear, acquire_sem failed!! */
- atomic_add(&mutex->LockCount, -1);
- return stat;
- }
- }
+ atomic_add(&mutex->LockCount, -1);
+ return stat;
+ }
+ }
mutex->owner = me;
mutex->owner_ref = 1;
@@ -107,78 +107,7 @@ APR_DECLARE(apr_status_t) apr_thread_mut
APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex)
{
- int32 stat;
- thread_id me = find_thread(NULL);
-
- if (mutex->nested && mutex->owner == me) {
- mutex->owner_ref++;
- return APR_SUCCESS;
- }
-
- if (atomic_add(&mutex->LockCount, 1) > 0) {
- if ((stat = acquire_sem_etc(mutex->Lock, 1, 0, 0)) < B_NO_ERROR) {
- atomic_add(&mutex->LockCount, -1);
- if (stat == B_WOULD_BLOCK) {
- stat = APR_EBUSY;
- }
- return stat;
- }
- }
-
- mutex->owner = me;
- mutex->owner_ref = 1;
-
- return APR_SUCCESS;
-}
-
-APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex,
- apr_time_t timeout,
- int absolute)
-{
- int32 stat;
- thread_id me = find_thread(NULL);
-
- if (mutex->nested && mutex->owner == me) {
- mutex->owner_ref++;
- return APR_SUCCESS;
- }
-
- if (atomic_add(&mutex->LockCount, 1) > 0) {
- if (timeout < 0) {
- stat = acquire_sem(mutex->Lock);
- }
- else {
- int flag = 0;
- if (timeout > 0) {
- if (absolute) {
- apr_time_t now = apr_time_now();
- if (timeout > now) {
- timeout -= now;
- }
- else {
- timeout = 0;
- }
- flag = B_ABSOLUTE_TIMEOUT;
- }
- else {
- flag = B_RELATIVE_TIMEOUT;
- }
- }
- stat = acquire_sem_etc(mutex->Lock, 1, flag, timeout);
- }
- if (stat < B_NO_ERROR) {
- atomic_add(&mutex->LockCount, -1);
- if (stat == B_TIMED_OUT) {
- stat = APR_TIMEUP;
- }
- return stat;
- }
- }
-
- mutex->owner = me;
- mutex->owner_ref = 1;
-
- return APR_SUCCESS;
+ return APR_ENOTIMPL;
}
APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex)
@@ -191,7 +120,7 @@ APR_DECLARE(apr_status_t) apr_thread_mut
return APR_SUCCESS;
}
- if (atomic_add(&mutex->LockCount, -1) > 1) {
+ if (atomic_add(&mutex->LockCount, -1) > 1) {
if ((stat = release_sem(mutex->Lock)) < B_NO_ERROR) {
atomic_add(&mutex->LockCount, 1);
return stat;
Modified: apr/apr/branches/1.6.x/locks/netware/proc_mutex.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/locks/netware/proc_mutex.c?rev=1796072&r1=1796071&r2=1796072&view=diff
==============================================================================
--- apr/apr/branches/1.6.x/locks/netware/proc_mutex.c (original)
+++ apr/apr/branches/1.6.x/locks/netware/proc_mutex.c Wed May 24 15:21:43 2017
@@ -26,24 +26,15 @@ APR_DECLARE(apr_status_t) apr_proc_mutex
apr_pool_t *pool)
{
apr_status_t ret;
- apr_proc_mutex_t *new_mutex;
- unsigned int flags = APR_THREAD_MUTEX_DEFAULT;
-
- *mutex = NULL;
- if (mech == APR_LOCK_DEFAULT_TIMED) {
- flags |= APR_THREAD_MUTEX_TIMED;
- }
- else if (mech != APR_LOCK_DEFAULT) {
- return APR_ENOTIMPL;
- }
-
+ apr_proc_mutex_t *new_mutex = NULL;
new_mutex = (apr_proc_mutex_t *)apr_pcalloc(pool, sizeof(apr_proc_mutex_t));
- if (new_mutex == NULL) {
+
+ if(new_mutex ==NULL) {
return APR_ENOMEM;
}
new_mutex->pool = pool;
- ret = apr_thread_mutex_create(&(new_mutex->mutex), flags, pool);
+ ret = apr_thread_mutex_create(&(new_mutex->mutex), APR_THREAD_MUTEX_DEFAULT, pool);
if (ret == APR_SUCCESS)
*mutex = new_mutex;
@@ -72,15 +63,6 @@ APR_DECLARE(apr_status_t) apr_proc_mutex
return APR_ENOLOCK;
}
-APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_thread_mutex_t *mutex,
- apr_time_t timeout,
- int absolute)
-{
- if (mutex)
- return apr_thread_mutex_timedlock(mutex->mutex, timeout, absolute);
- return APR_ENOLOCK;
-}
-
APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex)
{
if (mutex)
Modified: apr/apr/branches/1.6.x/locks/netware/thread_cond.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/locks/netware/thread_cond.c?rev=1796072&r1=1796071&r2=1796072&view=diff
==============================================================================
--- apr/apr/branches/1.6.x/locks/netware/thread_cond.c (original)
+++ apr/apr/branches/1.6.x/locks/netware/thread_cond.c Wed May 24 15:21:43 2017
@@ -66,21 +66,10 @@ APR_DECLARE(apr_status_t) apr_thread_con
APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond,
apr_thread_mutex_t *mutex,
- apr_interval_time_t timeout)
-{
- int rc;
- if (timeout < 0) {
- rc = NXCondWait(cond->cond, mutex->mutex);
- }
- else {
- timeout = timeout * 1000 / XGetSystemTick();
- rc = NXCondTimedWait(cond->cond, mutex->mutex, timeout);
- if (rc == NX_ETIMEDOUT) {
- return APR_TIMEUP;
- }
- }
- if (rc != 0) {
- return APR_EINTR;
+ apr_interval_time_t timeout){
+ if (NXCondTimedWait(cond->cond, mutex->mutex,
+ (timeout*1000)/NXGetSystemTick()) == NX_ETIMEDOUT) {
+ return APR_TIMEUP;
}
return APR_SUCCESS;
}
Modified: apr/apr/branches/1.6.x/locks/netware/thread_mutex.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/locks/netware/thread_mutex.c?rev=1796072&r1=1796071&r2=1796072&view=diff
==============================================================================
--- apr/apr/branches/1.6.x/locks/netware/thread_mutex.c (original)
+++ apr/apr/branches/1.6.x/locks/netware/thread_mutex.c Wed May 24 15:21:43 2017
@@ -19,7 +19,6 @@
#include "apr_general.h"
#include "apr_strings.h"
#include "apr_arch_thread_mutex.h"
-#include "apr_thread_cond.h"
#include "apr_portable.h"
static apr_status_t thread_mutex_cleanup(void *data)
@@ -42,8 +41,8 @@ APR_DECLARE(apr_status_t) apr_thread_mut
return APR_ENOTIMPL;
}
new_mutex = (apr_thread_mutex_t *)apr_pcalloc(pool, sizeof(apr_thread_mutex_t));
-
- if (new_mutex == NULL) {
+
+ if(new_mutex ==NULL) {
return APR_ENOMEM;
}
new_mutex->pool = pool;
@@ -53,14 +52,6 @@ APR_DECLARE(apr_status_t) apr_thread_mut
if(new_mutex->mutex == NULL)
return APR_ENOMEM;
- if (flags & APR_THREAD_MUTEX_TIMED) {
- apr_status_t rv = apr_thread_cond_create(&new_mutex->cond, pool);
- if (rv != SUCCESS) {
- NXMutexFree(new_mutex->mutex);
- return rv;
- }
- }
-
apr_pool_cleanup_register(new_mutex->pool, new_mutex,
(void*)thread_mutex_cleanup,
apr_pool_cleanup_null);
@@ -70,117 +61,29 @@ APR_DECLARE(apr_status_t) apr_thread_mut
APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex)
{
- if (mutex->cond) {
- apr_status_t rv;
- NXLock(mutex->mutex);
- if (mutex->locked) {
- mutex->num_waiters++;
- rv = apr_thread_cond_wait(mutex->cond, mutex);
- mutex->num_waiters--;
- }
- else {
- mutex->locked = 1;
- rv = APR_SUCCESS;
- }
- NXUnlock(mutex->mutex);
- return rv;
- }
-
NXLock(mutex->mutex);
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex)
{
- if (mutex->cond) {
- apr_status_t rv;
- NXLock(mutex->mutex);
- if (mutex->locked) {
- rv = APR_EBUSY;
- }
- else {
- mutex->locked = 1;
- rv = APR_SUCCESS;
- }
- NXUnlock(mutex->mutex);
- return rv;
- }
-
if (!NXTryLock(mutex->mutex))
return APR_EBUSY;
return APR_SUCCESS;
}
-APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex,
- apr_time_t timeout,
- int absolute)
-{
- if (mutex->cond) {
- apr_status_t rv;
- NXLock(mutex->mutex);
- if (mutex->locked) {
- mutex->num_waiters++;
- if (timeout < 0) {
- rv = apr_thread_cond_dwait(mutex->cond, mutex);
- }
- else {
- if (absolute) {
- apr_time_t now = apr_time_now();
- if (timeout > now) {
- timeout -= now;
- }
- else {
- timeout = 0;
- }
- }
- rv = apr_thread_cond_timedwait(mutex->cond, mutex, timeout);
- }
- mutex->num_waiters--;
- }
- else {
- mutex->locked = 1;
- rv = APR_SUCCESS;
- }
- NXUnlock(mutex->mutex);
- return rv;
- }
-
- return APR_ENOTIMPL;
-}
-
APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex)
{
- if (mutex->cond) {
- apr_status_t rv;
- NXLock(mutex->mutex);
- if (!mutex->locked) {
- rv = APR_EINVAL;
- }
- else if (mutex->num_waiters) {
- rv = apr_thread_cond_signal(mutex->cond);
- }
- else {
- mutex->locked = 0;
- rv = APR_SUCCESS;
- }
- NXUnlock(mutex->mutex);
- return rv;
- }
-
NXUnlock(mutex->mutex);
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex)
{
- apr_status_t stat, rv = APR_SUCCESS;
- if (mutex->cond) {
- rv = apr_thread_cond_destroy(mutex->cond);
- mutex->cond = NULL;
- }
- stat = apr_pool_cleanup_run(mutex->pool, mutex, thread_mutex_cleanup);
- if (stat == APR_SUCCESS && rv) {
- stat = rv;
+ apr_status_t stat;
+ if ((stat = thread_mutex_cleanup(mutex)) == APR_SUCCESS) {
+ apr_pool_cleanup_kill(mutex->pool, mutex, thread_mutex_cleanup);
+ return APR_SUCCESS;
}
return stat;
}
Modified: apr/apr/branches/1.6.x/locks/os2/proc_mutex.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/locks/os2/proc_mutex.c?rev=1796072&r1=1796071&r2=1796072&view=diff
==============================================================================
--- apr/apr/branches/1.6.x/locks/os2/proc_mutex.c (original)
+++ apr/apr/branches/1.6.x/locks/os2/proc_mutex.c Wed May 24 15:21:43 2017
@@ -85,7 +85,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex
ULONG rc;
char *semname;
- if (mech != APR_LOCK_DEFAULT && mech != APR_LOCK_DEFAULT_TIMED) {
+ if (mech != APR_LOCK_DEFAULT) {
return APR_ENOTIMPL;
}
@@ -153,42 +153,6 @@ APR_DECLARE(apr_status_t) apr_proc_mutex
if (rc == 0) {
mutex->owner = CurrentTid;
- mutex->lock_count++;
- }
-
- return APR_FROM_OS_ERROR(rc);
-}
-
-
-
-APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex,
- apr_time_t timeout,
- int absolute)
-{
- ULONG rc;
-
- if (timeout < 0) {
- rc = DosRequestMutexSem(mutex->hMutex, SEM_INDEFINITE_WAIT);
- }
- else {
- if (absolute) {
- apr_time_t now = apr_time_now();
- if (timeout > now) {
- timeout -= now;
- }
- else {
- timeout = 0;
- }
- }
-
- rc = DosRequestMutexSem(mutex->hMutex, apr_time_as_msec(timeout));
- if (rc == ERROR_TIMEOUT) {
- return APR_TIMEUP;
- }
- }
-
- if (rc == 0) {
- mutex->owner = CurrentTid;
mutex->lock_count++;
}
Modified: apr/apr/branches/1.6.x/locks/os2/thread_cond.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/locks/os2/thread_cond.c?rev=1796072&r1=1796071&r2=1796072&view=diff
==============================================================================
--- apr/apr/branches/1.6.x/locks/os2/thread_cond.c (original)
+++ apr/apr/branches/1.6.x/locks/os2/thread_cond.c Wed May 24 15:21:43 2017
@@ -23,172 +23,38 @@
#include "apr_arch_file_io.h"
#include <string.h>
-#ifndef DCE_POSTONE
-#define DCE_POSTONE 0x0800 // Post one flag
-#endif
-
-static apr_status_t thread_cond_cleanup(void *data)
-{
- apr_thread_cond_t *cv = data;
-
- if (cv->semaphore) {
- DosCloseEventSem(cv->semaphore);
- }
-
- if (cv->mutex) {
- DosCloseMutexSem(cv->mutex);
- }
-
- return APR_SUCCESS;
-}
-
-
-
APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond,
apr_pool_t *pool)
{
- int rc;
- apr_thread_cond_t *cv;
-
- cv = apr_pcalloc(pool, sizeof(**cond));
- rc = DosCreateEventSem(NULL, &cv->semaphore, DCE_POSTONE, FALSE);
-
- if (rc == 0) {
- rc = DosCreateMutexSem(NULL, &cv->mutex, 0, FALSE);
- }
-
- *cond = cv;
- cv->pool = pool;
- apr_pool_cleanup_register(cv->pool, cv, thread_cond_cleanup,
- apr_pool_cleanup_null);
-
- return APR_FROM_OS_ERROR(rc);
-}
-
-
-
-static apr_status_t thread_cond_timedwait(apr_thread_cond_t *cond,
- apr_thread_mutex_t *mutex,
- ULONG timeout_ms )
-{
- ULONG rc;
- apr_status_t rv = APR_SUCCESS;
- int wake = FALSE;
- unsigned long generation;
-
- DosRequestMutexSem(cond->mutex, SEM_INDEFINITE_WAIT);
- cond->num_waiting++;
- generation = cond->generation;
- DosReleaseMutexSem(cond->mutex);
-
- apr_thread_mutex_unlock(mutex);
-
- do {
- rc = DosWaitEventSem(cond->semaphore, timeout_ms);
-
- DosRequestMutexSem(cond->mutex, SEM_INDEFINITE_WAIT);
-
- if (cond->num_wake) {
- if (cond->generation != generation) {
- cond->num_wake--;
- cond->num_waiting--;
- rv = APR_SUCCESS;
- break;
- } else {
- wake = TRUE;
- }
- }
- else if (rc != 0) {
- cond->num_waiting--;
- rv = APR_TIMEUP;
- break;
- }
-
- DosReleaseMutexSem(cond->mutex);
-
- if (wake) {
- wake = FALSE;
- DosPostEventSem(cond->semaphore);
- }
- } while (1);
-
- DosReleaseMutexSem(cond->mutex);
- apr_thread_mutex_lock(mutex);
- return rv;
+ return APR_ENOTIMPL;
}
-
-
APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond,
apr_thread_mutex_t *mutex)
{
- return thread_cond_timedwait(cond, mutex, SEM_INDEFINITE_WAIT);
+ return APR_ENOTIMPL;
}
-
-
APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond,
apr_thread_mutex_t *mutex,
- apr_interval_time_t timeout)
-{
- ULONG timeout_ms = (timeout >= 0) ? apr_time_as_msec(timeout)
- : SEM_INDEFINITE_WAIT;
- return thread_cond_timedwait(cond, mutex, timeout_ms);
+ apr_interval_time_t timeout){
+ return APR_ENOTIMPL;
}
-
-
APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond)
{
- int wake = FALSE;
-
- DosRequestMutexSem(cond->mutex, SEM_INDEFINITE_WAIT);
-
- if (cond->num_waiting > cond->num_wake) {
- wake = TRUE;
- cond->num_wake++;
- cond->generation++;
- }
-
- DosReleaseMutexSem(cond->mutex);
-
- if (wake) {
- DosPostEventSem(cond->semaphore);
- }
-
- return APR_SUCCESS;
+ return APR_ENOTIMPL;
}
-
-
APR_DECLARE(apr_status_t) apr_thread_cond_broadcast(apr_thread_cond_t *cond)
{
- unsigned long num_wake = 0;
-
- DosRequestMutexSem(cond->mutex, SEM_INDEFINITE_WAIT);
-
- if (cond->num_waiting > cond->num_wake) {
- num_wake = cond->num_waiting - cond->num_wake;
- cond->num_wake = cond->num_waiting;
- cond->generation++;
- }
-
- DosReleaseMutexSem(cond->mutex);
-
- for (; num_wake; num_wake--) {
- DosPostEventSem(cond->semaphore);
- }
-
- return APR_SUCCESS;
+ return APR_ENOTIMPL;
}
-
-
APR_DECLARE(apr_status_t) apr_thread_cond_destroy(apr_thread_cond_t *cond)
{
- return apr_pool_cleanup_run(cond->pool, cond, thread_cond_cleanup);
+ return APR_ENOTIMPL;
}
-
-
APR_POOL_IMPLEMENT_ACCESSOR(thread_cond)
+
Modified: apr/apr/branches/1.6.x/locks/os2/thread_mutex.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/locks/os2/thread_mutex.c?rev=1796072&r1=1796071&r2=1796072&view=diff
==============================================================================
--- apr/apr/branches/1.6.x/locks/os2/thread_mutex.c (original)
+++ apr/apr/branches/1.6.x/locks/os2/thread_mutex.c Wed May 24 15:21:43 2017
@@ -71,36 +71,6 @@ APR_DECLARE(apr_status_t) apr_thread_mut
-APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex,
- apr_time_t timeout,
- int absolute)
-{
- ULONG rc;
-
- if (timeout < 0) {
- rc = DosRequestMutexSem(mutex->hMutex, SEM_INDEFINITE_WAIT);
- }
- else {
- if (absolute) {
- apr_time_t now = apr_time_now();
- if (timeout > now) {
- timeout -= now;
- }
- else {
- timeout = 0;
- }
- }
- rc = DosRequestMutexSem(mutex->hMutex, apr_time_as_msec(usec));
- if (rc == ERROR_TIMEOUT) {
- return APR_TIMEUP;
- }
- }
-
- return APR_FROM_OS_ERROR(rc);
-}
-
-
-
APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex)
{
ULONG rc = DosReleaseMutexSem(mutex->hMutex);
Modified: apr/apr/branches/1.6.x/locks/unix/global_mutex.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/locks/unix/global_mutex.c?rev=1796072&r1=1796071&r2=1796072&view=diff
==============================================================================
--- apr/apr/branches/1.6.x/locks/unix/global_mutex.c (original)
+++ apr/apr/branches/1.6.x/locks/unix/global_mutex.c Wed May 24 15:21:43 2017
@@ -142,40 +142,6 @@ APR_DECLARE(apr_status_t) apr_global_mut
return rv;
}
-APR_DECLARE(apr_status_t) apr_global_mutex_timedlock(apr_global_mutex_t *mutex,
- apr_time_t timeout,
- int absolute)
-{
- apr_status_t rv;
-
-#if APR_HAS_THREADS
- if (mutex->thread_mutex) {
- if (timeout >= 0 && !absolute) {
- timeout += apr_time_now();
- absolute = 1;
- }
- rv = apr_thread_mutex_timedlock(mutex->thread_mutex, timeout,
- absolute);
- if (rv != APR_SUCCESS) {
- return rv;
- }
- }
-#endif /* APR_HAS_THREADS */
-
- rv = apr_proc_mutex_timedlock(mutex->proc_mutex, timeout,
- absolute);
-
-#if APR_HAS_THREADS
- if (rv != APR_SUCCESS) {
- if (mutex->thread_mutex) {
- (void)apr_thread_mutex_unlock(mutex->thread_mutex);
- }
- }
-#endif /* APR_HAS_THREADS */
-
- return rv;
-}
-
APR_DECLARE(apr_status_t) apr_global_mutex_unlock(apr_global_mutex_t *mutex)
{
apr_status_t rv;
Modified: apr/apr/branches/1.6.x/locks/unix/proc_mutex.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/locks/unix/proc_mutex.c?rev=1796072&r1=1796071&r2=1796072&view=diff
==============================================================================
--- apr/apr/branches/1.6.x/locks/unix/proc_mutex.c (original)
+++ apr/apr/branches/1.6.x/locks/unix/proc_mutex.c Wed May 24 15:21:43 2017
@@ -183,41 +183,6 @@ static apr_status_t proc_mutex_posix_try
return APR_SUCCESS;
}
-static apr_status_t proc_mutex_posix_timedacquire(apr_proc_mutex_t *mutex,
- apr_time_t timeout,
- int absolute)
-{
-#if HAVE_SEM_TIMEDWAIT
- if (timeout < 0) {
- return proc_mutex_posix_acquire(mutex);
- }
- else {
- int rc;
- struct timespec abstime;
-
- if (!absolute) {
- timeout += apr_time_now();
- }
- abstime.tv_sec = apr_time_sec(timeout);
- abstime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */
-
- do {
- rc = sem_timedwait(mutex->os.psem_interproc, &abstime);
- } while (rc < 0 && errno == EINTR);
- if (rc < 0) {
- if (errno == ETIMEDOUT) {
- return APR_TIMEUP;
- }
- return errno;
- }
- }
- mutex->curr_locked = 1;
- return APR_SUCCESS;
-#else
- return APR_ENOTIMPL;
-#endif
-}
-
static apr_status_t proc_mutex_posix_release(apr_proc_mutex_t *mutex)
{
mutex->curr_locked = 0;
@@ -239,7 +204,6 @@ static const apr_proc_mutex_unix_lock_me
proc_mutex_posix_create,
proc_mutex_posix_acquire,
proc_mutex_posix_tryacquire,
- proc_mutex_posix_timedacquire,
proc_mutex_posix_release,
proc_mutex_posix_cleanup,
proc_mutex_no_child_init,
@@ -338,40 +302,6 @@ static apr_status_t proc_mutex_sysv_trya
return APR_SUCCESS;
}
-static apr_status_t proc_mutex_sysv_timedacquire(apr_proc_mutex_t *mutex,
- apr_time_t timeout,
- int absolute)
-{
-#if HAVE_SEMTIMEDOP
- if (timeout < 0) {
- return proc_mutex_sysv_acquire(mutex);
- }
- else {
- int rc;
- struct timespec abstime;
- if (!absolute) {
- timeout += apr_time_now();
- }
- abstime.tv_sec = apr_time_sec(timeout);
- abstime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */
- do {
- rc = semtimedop(mutex->os.crossproc, &proc_mutex_op_on, 1,
- &abstime);
- } while (rc < 0 && errno == EINTR);
- if (rc < 0) {
- if (errno == EAGAIN) {
- return APR_TIMEUP;
- }
- return errno;
- }
- }
- mutex->curr_locked = 1;
- return APR_SUCCESS;
-#else
- return APR_ENOTIMPL;
-#endif
-}
-
static apr_status_t proc_mutex_sysv_release(apr_proc_mutex_t *mutex)
{
int rc;
@@ -414,7 +344,6 @@ static const apr_proc_mutex_unix_lock_me
proc_mutex_sysv_create,
proc_mutex_sysv_acquire,
proc_mutex_sysv_tryacquire,
- proc_mutex_sysv_timedacquire,
proc_mutex_sysv_release,
proc_mutex_sysv_cleanup,
proc_mutex_no_child_init,
@@ -650,47 +579,6 @@ static apr_status_t proc_mutex_proc_pthr
return APR_SUCCESS;
}
-static apr_status_t
-proc_mutex_proc_pthread_timedacquire(apr_proc_mutex_t *mutex,
- apr_time_t timeout,
- int absolute)
-{
- if (timeout < 0) {
- return proc_mutex_proc_pthread_acquire(mutex);
- }
- else {
- apr_status_t rv;
- struct timespec abstime;
-
- if (!absolute) {
- timeout += apr_time_now();
- }
- abstime.tv_sec = apr_time_sec(timeout);
- abstime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */
-
- if ((rv = pthread_mutex_timedlock(mutex->os.pthread_interproc,
- &abstime))) {
-#ifdef HAVE_ZOS_PTHREADS
- rv = errno;
-#endif
- if (rv == ETIMEDOUT) {
- return APR_TIMEUP;
- }
-#ifdef HAVE_PTHREAD_MUTEX_ROBUST
- /* Okay, our owner died. Let's try to make it consistent again. */
- if (rv == EOWNERDEAD) {
- proc_pthread_mutex_dec(mutex);
- pthread_mutex_consistent_np(mutex->os.pthread_interproc);
- }
- else
-#endif
- return rv;
- }
- }
- mutex->curr_locked = 1;
- return APR_SUCCESS;
-}
-
static apr_status_t proc_mutex_proc_pthread_release(apr_proc_mutex_t *mutex)
{
apr_status_t rv;
@@ -711,7 +599,6 @@ static const apr_proc_mutex_unix_lock_me
proc_mutex_proc_pthread_create,
proc_mutex_proc_pthread_acquire,
proc_mutex_proc_pthread_tryacquire,
- proc_mutex_proc_pthread_timedacquire,
proc_mutex_proc_pthread_release,
proc_mutex_proc_pthread_cleanup,
proc_mutex_proc_pthread_child_init,
@@ -835,13 +722,6 @@ static apr_status_t proc_mutex_fcntl_try
return APR_SUCCESS;
}
-static apr_status_t proc_mutex_fcntl_timedacquire(apr_proc_mutex_t *mutex,
- apr_time_t timeout,
- int absolute)
-{
- return APR_ENOTIMPL;
-}
-
static apr_status_t proc_mutex_fcntl_release(apr_proc_mutex_t *mutex)
{
int rc;
@@ -882,7 +762,6 @@ static const apr_proc_mutex_unix_lock_me
proc_mutex_fcntl_create,
proc_mutex_fcntl_acquire,
proc_mutex_fcntl_tryacquire,
- proc_mutex_fcntl_timedacquire,
proc_mutex_fcntl_release,
proc_mutex_fcntl_cleanup,
proc_mutex_no_child_init,
@@ -986,13 +865,6 @@ static apr_status_t proc_mutex_flock_try
return APR_SUCCESS;
}
-static apr_status_t proc_mutex_flock_timedacquire(apr_proc_mutex_t *mutex,
- apr_time_t timeout,
- int absolute)
-{
- return APR_ENOTIMPL;
-}
-
static apr_status_t proc_mutex_flock_release(apr_proc_mutex_t *mutex)
{
int rc;
@@ -1063,7 +935,6 @@ static const apr_proc_mutex_unix_lock_me
proc_mutex_flock_create,
proc_mutex_flock_acquire,
proc_mutex_flock_tryacquire,
- proc_mutex_flock_timedacquire,
proc_mutex_flock_release,
proc_mutex_flock_cleanup,
proc_mutex_flock_child_init,
@@ -1215,21 +1086,6 @@ static apr_status_t proc_mutex_choose_me
return APR_ENOTIMPL;
#endif
break;
- case APR_LOCK_DEFAULT_TIMED:
-#if APR_HAS_PROC_PTHREAD_SERIALIZE \
- && defined(HAVE_PTHREAD_MUTEX_ROBUST) \
- && defined(HAVE_PTHREAD_MUTEX_TIMEDLOCK)
- new_mutex->meth = &mutex_proc_pthread_methods;
-#elif APR_HAS_SYSVSEM_SERIALIZE \
- && defined(HAVE_SEMTIMEDOP)
- new_mutex->meth = &mutex_sysv_methods;
-#elif APR_HAS_POSIXSEM_SERIALIZE \
- && defined(HAVE_SEM_TIMEDWAIT)
- new_mutex->meth = &mutex_posixsem_methods;
-#else
- return APR_ENOTIMPL;
-#endif
- break;
default:
return APR_ENOTIMPL;
}
@@ -1300,13 +1156,6 @@ APR_DECLARE(apr_status_t) apr_proc_mutex
return mutex->meth->tryacquire(mutex);
}
-APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex,
- apr_time_t timeout,
- int absolute)
-{
- return mutex->meth->timedacquire(mutex, timeout, absolute);
-}
-
APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex)
{
return mutex->meth->release(mutex);
Modified: apr/apr/branches/1.6.x/locks/unix/thread_cond.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/locks/unix/thread_cond.c?rev=1796072&r1=1796071&r2=1796072&view=diff
==============================================================================
--- apr/apr/branches/1.6.x/locks/unix/thread_cond.c (original)
+++ apr/apr/branches/1.6.x/locks/unix/thread_cond.c Wed May 24 15:21:43 2017
@@ -79,31 +79,21 @@ APR_DECLARE(apr_status_t) apr_thread_con
apr_interval_time_t timeout)
{
apr_status_t rv;
- if (timeout < 0) {
- rv = pthread_cond_wait(&cond->cond, &mutex->mutex);
-#ifdef HAVE_ZOS_PTHREADS
- if (rv) {
- rv = errno;
- }
-#endif
- }
- else {
- apr_time_t then;
- struct timespec abstime;
+ apr_time_t then;
+ struct timespec abstime;
- then = apr_time_now() + timeout;
- abstime.tv_sec = apr_time_sec(then);
- abstime.tv_nsec = apr_time_usec(then) * 1000; /* nanoseconds */
+ then = apr_time_now() + timeout;
+ abstime.tv_sec = apr_time_sec(then);
+ abstime.tv_nsec = apr_time_usec(then) * 1000; /* nanoseconds */
- rv = pthread_cond_timedwait(&cond->cond, &mutex->mutex, &abstime);
+ rv = pthread_cond_timedwait(&cond->cond, &mutex->mutex, &abstime);
#ifdef HAVE_ZOS_PTHREADS
- if (rv) {
- rv = errno;
- }
+ if (rv) {
+ rv = errno;
+ }
#endif
- if (ETIMEDOUT == rv) {
- return APR_TIMEUP;
- }
+ if (ETIMEDOUT == rv) {
+ return APR_TIMEUP;
}
return rv;
}
Modified: apr/apr/branches/1.6.x/locks/unix/thread_mutex.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/locks/unix/thread_mutex.c?rev=1796072&r1=1796071&r2=1796072&view=diff
==============================================================================
--- apr/apr/branches/1.6.x/locks/unix/thread_mutex.c (original)
+++ apr/apr/branches/1.6.x/locks/unix/thread_mutex.c Wed May 24 15:21:43 2017
@@ -77,19 +77,6 @@ APR_DECLARE(apr_status_t) apr_thread_mut
return rv;
}
-#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK
- if (flags & APR_THREAD_MUTEX_TIMED) {
- rv = apr_thread_cond_create(&new_mutex->cond, pool);
- if (rv) {
-#ifdef HAVE_ZOS_PTHREADS
- rv = errno;
-#endif
- pthread_mutex_destroy(&new_mutex->mutex);
- return rv;
- }
- }
-#endif
-
apr_pool_cleanup_register(new_mutex->pool,
new_mutex, thread_mutex_cleanup,
apr_pool_cleanup_null);
@@ -102,45 +89,13 @@ APR_DECLARE(apr_status_t) apr_thread_mut
{
apr_status_t rv;
- if (mutex->cond) {
- apr_status_t rv2;
-
- rv = pthread_mutex_lock(&mutex->mutex);
- if (rv) {
-#ifdef HAVE_ZOS_PTHREADS
- rv = errno;
-#endif
- return rv;
- }
-
- if (mutex->locked) {
- mutex->num_waiters++;
- rv = apr_thread_cond_wait(mutex->cond, mutex);
- mutex->num_waiters--;
- }
- else {
- mutex->locked = 1;
- }
-
- rv2 = pthread_mutex_unlock(&mutex->mutex);
- if (rv2 && !rv) {
-#ifdef HAVE_ZOS_PTHREADS
- rv = errno;
-#else
- rv = rv2;
-#endif
- }
-
- return rv;
- }
-
rv = pthread_mutex_lock(&mutex->mutex);
#ifdef HAVE_ZOS_PTHREADS
if (rv) {
rv = errno;
}
#endif
-
+
return rv;
}
@@ -148,36 +103,6 @@ APR_DECLARE(apr_status_t) apr_thread_mut
{
apr_status_t rv;
- if (mutex->cond) {
- apr_status_t rv2;
-
- rv = pthread_mutex_lock(&mutex->mutex);
- if (rv) {
-#ifdef HAVE_ZOS_PTHREADS
- rv = errno;
-#endif
- return rv;
- }
-
- if (mutex->locked) {
- rv = APR_EBUSY;
- }
- else {
- mutex->locked = 1;
- }
-
- rv2 = pthread_mutex_unlock(&mutex->mutex);
- if (rv2) {
-#ifdef HAVE_ZOS_PTHREADS
- rv = errno;
-#else
- rv = rv2;
-#endif
- }
-
- return rv;
- }
-
rv = pthread_mutex_trylock(&mutex->mutex);
if (rv) {
#ifdef HAVE_ZOS_PTHREADS
@@ -189,130 +114,10 @@ APR_DECLARE(apr_status_t) apr_thread_mut
return APR_SUCCESS;
}
-APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex,
- apr_time_t timeout,
- int absolute)
-{
- apr_status_t rv = APR_ENOTIMPL;
-
-#ifdef HAVE_PTHREAD_MUTEX_TIMEDLOCK
- if (timeout < 0) {
- rv = pthread_mutex_lock(&mutex->mutex);
- if (rv) {
-#ifdef HAVE_ZOS_PTHREADS
- rv = errno;
-#endif
- }
- }
- else {
- struct timespec abstime;
-
- if (!absolute) {
- timeout += apr_time_now();
- }
- abstime.tv_sec = apr_time_sec(timeout);
- abstime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */
-
- rv = pthread_mutex_timedlock(&mutex->mutex, &abstime);
- if (rv) {
-#ifdef HAVE_ZOS_PTHREADS
- rv = errno;
-#endif
- if (rv == ETIMEDOUT) {
- rv = APR_TIMEUP;
- }
- }
- }
-
-#else /* HAVE_PTHREAD_MUTEX_TIMEDLOCK */
-
- if (mutex->cond) {
- apr_status_t rv2;
-
- rv = pthread_mutex_lock(&mutex->mutex);
- if (rv) {
-#ifdef HAVE_ZOS_PTHREADS
- rv = errno;
-#endif
- return rv;
- }
-
- if (mutex->locked) {
- mutex->num_waiters++;
- if (timeout < 0) {
- rv = apr_thread_cond_wait(mutex->cond, mutex);
- }
- else {
- if (absolute) {
- apr_time_t now = apr_time_now();
- if (timeout > now) {
- timeout -= now;
- }
- else {
- timeout = 0;
- }
- }
- rv = apr_thread_cond_timedwait(mutex->cond, mutex, timeout);
- }
- mutex->num_waiters--;
- }
- else {
- mutex->locked = 1;
- }
-
- rv2 = pthread_mutex_unlock(&mutex->mutex);
- if (rv2 && !rv) {
-#ifdef HAVE_ZOS_PTHREADS
- rv = errno;
-#else
- rv = rv2;
-#endif
- }
- }
-
-#endif /* HAVE_PTHREAD_MUTEX_TIMEDLOCK */
-
- return rv;
-}
-
APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex)
{
apr_status_t status;
- if (mutex->cond) {
- apr_status_t stat2;
-
- status = pthread_mutex_lock(&mutex->mutex);
- if (status) {
-#ifdef HAVE_ZOS_PTHREADS
- status = errno;
-#endif
- return status;
- }
-
- if (!mutex->locked) {
- status = APR_EINVAL;
- }
- else if (mutex->num_waiters) {
- status = apr_thread_cond_signal(mutex->cond);
- }
- else {
- mutex->locked = 0;
- status = APR_SUCCESS;
- }
-
- stat2 = pthread_mutex_unlock(&mutex->mutex);
- if (stat2) {
-#ifdef HAVE_ZOS_PTHREADS
- status = errno;
-#else
- status = stat2;
-#endif
- }
-
- return status;
- }
-
status = pthread_mutex_unlock(&mutex->mutex);
#ifdef HAVE_ZOS_PTHREADS
if (status) {
@@ -325,17 +130,7 @@ APR_DECLARE(apr_status_t) apr_thread_mut
APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex)
{
- apr_status_t rv, rv2 = APR_SUCCESS;
-
- if (mutex->cond) {
- rv2 = apr_thread_cond_destroy(mutex->cond);
- }
- rv = apr_pool_cleanup_run(mutex->pool, mutex, thread_mutex_cleanup);
- if (rv == APR_SUCCESS) {
- rv = rv2;
- }
-
- return rv;
+ return apr_pool_cleanup_run(mutex->pool, mutex, thread_mutex_cleanup);
}
APR_POOL_IMPLEMENT_ACCESSOR(thread_mutex)
Modified: apr/apr/branches/1.6.x/locks/win32/proc_mutex.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/locks/win32/proc_mutex.c?rev=1796072&r1=1796071&r2=1796072&view=diff
==============================================================================
--- apr/apr/branches/1.6.x/locks/win32/proc_mutex.c (original)
+++ apr/apr/branches/1.6.x/locks/win32/proc_mutex.c Wed May 24 15:21:43 2017
@@ -164,37 +164,6 @@ APR_DECLARE(apr_status_t) apr_proc_mutex
return apr_get_os_error();
}
-APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex,
- apr_time_t timeout,
- int absolute)
-{
- DWORD rv;
-
- if (timeout < 0) {
- rv = WaitForSingleObject(mutex->handle, INFINITE);
- }
- else {
- if (absolute) {
- apr_time_t now = apr_time_now();
- if (timeout > now) {
- timeout -= now;
- }
- else {
- timeout = 0;
- }
- }
- rv = WaitForSingleObject(mutex->handle, apr_time_as_msec(timeout));
- if (rv == WAIT_TIMEOUT) {
- return APR_TIMEUP;
- }
- }
-
- if (rv == WAIT_OBJECT_0 || rv == WAIT_ABANDONED) {
- return APR_SUCCESS;
- }
- return apr_get_os_error();
-}
-
APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex)
{
if (ReleaseMutex(mutex->handle) == 0) {
Modified: apr/apr/branches/1.6.x/locks/win32/thread_cond.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/locks/win32/thread_cond.c?rev=1796072&r1=1796071&r2=1796072&view=diff
==============================================================================
--- apr/apr/branches/1.6.x/locks/win32/thread_cond.c (original)
+++ apr/apr/branches/1.6.x/locks/win32/thread_cond.c Wed May 24 15:21:43 2017
@@ -61,9 +61,9 @@ APR_DECLARE(apr_status_t) apr_thread_con
return apr_pool_cleanup_run(cond->pool, cond, thread_cond_cleanup);
}
-static APR_INLINE apr_status_t thread_cond_timedwait(apr_thread_cond_t *cond,
- apr_thread_mutex_t *mutex,
- DWORD timeout_ms )
+static APR_INLINE apr_status_t _thread_cond_timedwait(apr_thread_cond_t *cond,
+ apr_thread_mutex_t *mutex,
+ DWORD timeout_ms )
{
DWORD res;
apr_status_t rv;
@@ -115,15 +115,16 @@ static APR_INLINE apr_status_t thread_co
APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond,
apr_thread_mutex_t *mutex)
{
- return thread_cond_timedwait(cond, mutex, INFINITE);
+ return _thread_cond_timedwait(cond, mutex, INFINITE);
}
APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond,
apr_thread_mutex_t *mutex,
apr_interval_time_t timeout)
{
- DWORD timeout_ms = (timeout >= 0) ? apr_time_as_msec(timeout) : INFINITE;
- return thread_cond_timedwait(cond, mutex, timeout_ms);
+ DWORD timeout_ms = (DWORD) apr_time_as_msec(timeout);
+
+ return _thread_cond_timedwait(cond, mutex, timeout_ms);
}
APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond)
Modified: apr/apr/branches/1.6.x/locks/win32/thread_mutex.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/locks/win32/thread_mutex.c?rev=1796072&r1=1796071&r2=1796072&view=diff
==============================================================================
--- apr/apr/branches/1.6.x/locks/win32/thread_mutex.c (original)
+++ apr/apr/branches/1.6.x/locks/win32/thread_mutex.c Wed May 24 15:21:43 2017
@@ -54,10 +54,6 @@ APR_DECLARE(apr_status_t) apr_thread_mut
(*mutex)->type = thread_mutex_unnested_event;
(*mutex)->handle = CreateEvent(NULL, FALSE, TRUE, NULL);
}
- else if (flags & APR_THREAD_MUTEX_TIMED) {
- (*mutex)->type = thread_mutex_nested_mutex;
- (*mutex)->handle = CreateMutex(NULL, FALSE, NULL);
- }
else {
#if APR_HAS_UNICODE_FS
/* Critical Sections are terrific, performance-wise, on NT.
@@ -67,7 +63,6 @@ APR_DECLARE(apr_status_t) apr_thread_mut
IF_WIN_OS_IS_UNICODE {
InitializeCriticalSection(&(*mutex)->section);
(*mutex)->type = thread_mutex_critical_section;
- (*mutex)->handle = NULL;
}
#endif
#if APR_HAS_ANSI_FS
@@ -91,9 +86,9 @@ APR_DECLARE(apr_status_t) apr_thread_mut
}
else {
DWORD rv = WaitForSingleObject(mutex->handle, INFINITE);
- if ((rv != WAIT_OBJECT_0) && (rv != WAIT_ABANDONED)) {
+ if ((rv != WAIT_OBJECT_0) && (rv != WAIT_ABANDONED)) {
return (rv == WAIT_TIMEOUT) ? APR_EBUSY : apr_get_os_error();
- }
+ }
}
return APR_SUCCESS;
}
@@ -107,44 +102,13 @@ APR_DECLARE(apr_status_t) apr_thread_mut
}
else {
DWORD rv = WaitForSingleObject(mutex->handle, 0);
- if ((rv != WAIT_OBJECT_0) && (rv != WAIT_ABANDONED)) {
+ if ((rv != WAIT_OBJECT_0) && (rv != WAIT_ABANDONED)) {
return (rv == WAIT_TIMEOUT) ? APR_EBUSY : apr_get_os_error();
- }
+ }
}
return APR_SUCCESS;
}
-APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex,
- apr_time_t timeout,
- int absolute)
-{
- if (mutex->type != thread_mutex_critical_section) {
- DWORD rv, timeout_ms;
- if (timeout < 0) {
- timeout_ms = INFINITE;
- }
- else {
- if (absolute) {
- apr_time_t now = apr_time_now();
- if (timeout > now) {
- timeout -= now;
- }
- else {
- timeout = 0;
- }
- }
- timeout_ms = apr_time_as_msec(timeout);
- }
- rv = WaitForSingleObject(mutex->handle, timeout_ms);
- if ((rv != WAIT_OBJECT_0) && (rv != WAIT_ABANDONED)) {
- return (rv == WAIT_TIMEOUT) ? APR_TIMEUP : apr_get_os_error();
- }
- return APR_SUCCESS;
- }
-
- return APR_ENOTIMPL;
-}
-
APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex)
{
if (mutex->type == thread_mutex_critical_section) {
Modified: apr/apr/branches/1.6.x/test/testglobalmutex.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/test/testglobalmutex.c?rev=1796072&r1=1796071&r2=1796072&view=diff
==============================================================================
--- apr/apr/branches/1.6.x/test/testglobalmutex.c (original)
+++ apr/apr/branches/1.6.x/test/testglobalmutex.c Wed May 24 15:21:43 2017
@@ -68,7 +68,6 @@ static const char *mutexname(apr_lockmec
case APR_LOCK_PROC_PTHREAD: return "proc_pthread";
case APR_LOCK_POSIXSEM: return "posixsem";
case APR_LOCK_DEFAULT: return "default";
- case APR_LOCK_DEFAULT_TIMED: return "default_timed";
default: return "unknown";
}
}
@@ -130,8 +129,6 @@ abts_suite *testglobalmutex(abts_suite *
mech = APR_LOCK_FLOCK;
abts_run_test(suite, test_exclusive, &mech);
#endif
- mech = APR_LOCK_DEFAULT_TIMED;
- abts_run_test(suite, test_exclusive, &mech);
return suite;
}
Modified: apr/apr/branches/1.6.x/test/testlock.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/test/testlock.c?rev=1796072&r1=1796071&r2=1796072&view=diff
==============================================================================
--- apr/apr/branches/1.6.x/test/testlock.c (original)
+++ apr/apr/branches/1.6.x/test/testlock.c Wed May 24 15:21:43 2017
@@ -90,12 +90,7 @@ static void *APR_THREAD_FUNC thread_mute
while (1)
{
- if (data) {
- apr_thread_mutex_timedlock(thread_mutex, *(apr_time_t *)data, 0);
- }
- else {
- apr_thread_mutex_lock(thread_mutex);
- }
+ apr_thread_mutex_lock(thread_mutex);
if (i == MAX_ITER)
exitLoop = 0;
else
@@ -183,38 +178,6 @@ static void test_thread_mutex(abts_case
ABTS_INT_EQUAL(tc, MAX_ITER, x);
}
-static void test_thread_timedmutex(abts_case *tc, void *data)
-{
- apr_thread_t *t1, *t2, *t3, *t4;
- apr_status_t s1, s2, s3, s4;
- apr_time_t timeout;
-
- s1 = apr_thread_mutex_create(&thread_mutex, APR_THREAD_MUTEX_TIMED, p);
- ABTS_INT_EQUAL(tc, APR_SUCCESS, s1);
- ABTS_PTR_NOTNULL(tc, thread_mutex);
-
- i = 0;
- x = 0;
-
- timeout = apr_time_from_sec(5);
-
- s1 = apr_thread_create(&t1, NULL, thread_mutex_function, &timeout, p);
- ABTS_INT_EQUAL(tc, APR_SUCCESS, s1);
- s2 = apr_thread_create(&t2, NULL, thread_mutex_function, &timeout, p);
- ABTS_INT_EQUAL(tc, APR_SUCCESS, s2);
- s3 = apr_thread_create(&t3, NULL, thread_mutex_function, &timeout, p);
- ABTS_INT_EQUAL(tc, APR_SUCCESS, s3);
- s4 = apr_thread_create(&t4, NULL, thread_mutex_function, &timeout, p);
- ABTS_INT_EQUAL(tc, APR_SUCCESS, s4);
-
- apr_thread_join(&s1, t1);
- apr_thread_join(&s2, t2);
- apr_thread_join(&s3, t3);
- apr_thread_join(&s4, t4);
-
- ABTS_INT_EQUAL(tc, MAX_ITER, x);
-}
-
static void test_thread_rwlock(abts_case *tc, void *data)
{
apr_thread_t *t1, *t2, *t3, *t4;
@@ -342,38 +305,6 @@ static void test_timeoutcond(abts_case *
apr_thread_cond_destroy(timeout_cond));
}
-static void test_timeoutmutex(abts_case *tc, void *data)
-{
- apr_status_t s;
- apr_time_t begin, end;
- apr_time_t timeout;
- int i;
-
- s = apr_thread_mutex_create(&timeout_mutex, APR_THREAD_MUTEX_TIMED, p);
- ABTS_INT_EQUAL(tc, APR_SUCCESS, s);
- ABTS_PTR_NOTNULL(tc, timeout_mutex);
-
- timeout = apr_time_from_sec(5);
-
- ABTS_INT_EQUAL(tc, 0, apr_thread_mutex_lock(timeout_mutex));
- for (i = 0; i < MAX_RETRY; i++) {
- begin = apr_time_now();
- s = apr_thread_mutex_timedlock(timeout_mutex, timeout, 0);
- end = apr_time_now();
-
- if (s != APR_SUCCESS && !APR_STATUS_IS_TIMEUP(s)) {
- continue;
- }
- ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(s));
- ABTS_ASSERT(tc, "Timer returned too late", end - begin - timeout < 100000);
- break;
- }
- ABTS_ASSERT(tc, "Too many retries", i < MAX_RETRY);
- ABTS_INT_EQUAL(tc, 0, apr_thread_mutex_unlock(timeout_mutex));
- APR_ASSERT_SUCCESS(tc, "Unable to destroy the mutex",
- apr_thread_mutex_destroy(timeout_mutex));
-}
-
#endif /* !APR_HAS_THREADS */
#if !APR_HAS_THREADS
@@ -392,11 +323,9 @@ abts_suite *testlock(abts_suite *suite)
abts_run_test(suite, threads_not_impl, NULL);
#else
abts_run_test(suite, test_thread_mutex, NULL);
- abts_run_test(suite, test_thread_timedmutex, NULL);
abts_run_test(suite, test_thread_rwlock, NULL);
abts_run_test(suite, test_cond, NULL);
abts_run_test(suite, test_timeoutcond, NULL);
- abts_run_test(suite, test_timeoutmutex, NULL);
#endif
return suite;
Modified: apr/apr/branches/1.6.x/test/testlockperf.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/test/testlockperf.c?rev=1796072&r1=1796071&r2=1796072&view=diff
==============================================================================
--- apr/apr/branches/1.6.x/test/testlockperf.c (original)
+++ apr/apr/branches/1.6.x/test/testlockperf.c Wed May 24 15:21:43 2017
@@ -60,12 +60,7 @@ void * APR_THREAD_FUNC thread_mutex_func
int i;
for (i = 0; i < max_counter; i++) {
- if (data) {
- apr_thread_mutex_timedlock(thread_lock, *(apr_time_t *)data, 0);
- }
- else {
- apr_thread_mutex_lock(thread_lock);
- }
+ apr_thread_mutex_lock(thread_lock);
mutex_counter++;
apr_thread_mutex_unlock(thread_lock);
}
@@ -180,57 +175,6 @@ int test_thread_mutex_nested(int num_thr
return APR_SUCCESS;
}
-static int test_thread_mutex_timed(int num_threads)
-{
- apr_thread_t *t[MAX_THREADS];
- apr_status_t s[MAX_THREADS];
- apr_time_t time_start, time_stop;
- apr_time_t timeout;
- int i;
-
- mutex_counter = 0;
-
- timeout = apr_time_from_sec(5);
-
- printf("apr_thread_mutex_t Tests\n");
- printf("%-60s", " Initializing the apr_thread_mutex_t (TIMED)");
- s[0] = apr_thread_mutex_create(&thread_lock, APR_THREAD_MUTEX_TIMED, pool);
- if (s[0] != APR_SUCCESS) {
- printf("Failed!\n");
- return s[0];
- }
- printf("OK\n");
-
- apr_thread_mutex_lock(thread_lock);
- /* set_concurrency(4)? -aaron */
- printf(" Starting %d threads ", num_threads);
- for (i = 0; i < num_threads; ++i) {
- s[i] = apr_thread_create(&t[i], NULL, thread_mutex_func, &timeout, pool);
- if (s[i] != APR_SUCCESS) {
- printf("Failed!\n");
- return s[i];
- }
- }
- printf("OK\n");
-
- time_start = apr_time_now();
- apr_thread_mutex_unlock(thread_lock);
-
- /* printf("%-60s", " Waiting for threads to exit"); */
- for (i = 0; i < num_threads; ++i) {
- apr_thread_join(&s[i], t[i]);
- }
- /* printf("OK\n"); */
-
- time_stop = apr_time_now();
- printf("microseconds: %" APR_INT64_T_FMT " usec\n",
- (time_stop - time_start));
- if (mutex_counter != max_counter * num_threads)
- printf("error: counter = %ld\n", mutex_counter);
-
- return APR_SUCCESS;
-}
-
int test_thread_rwlock(int num_threads)
{
apr_thread_t *t[MAX_THREADS];
@@ -329,12 +273,6 @@ int main(int argc, const char * const *a
exit(-4);
}
- if ((rv = test_thread_mutex_timed(i)) != APR_SUCCESS) {
- fprintf(stderr,"thread_mutex (TIMED) test failed : [%d] %s\n",
- rv, apr_strerror(rv, (char*)errmsg, 200));
- exit(-5);
- }
-
if ((rv = test_thread_rwlock(i)) != APR_SUCCESS) {
fprintf(stderr,"thread_rwlock test failed : [%d] %s\n",
rv, apr_strerror(rv, (char*)errmsg, 200));
Modified: apr/apr/branches/1.6.x/test/testmutexscope.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/test/testmutexscope.c?rev=1796072&r1=1796071&r2=1796072&view=diff
==============================================================================
--- apr/apr/branches/1.6.x/test/testmutexscope.c (original)
+++ apr/apr/branches/1.6.x/test/testmutexscope.c Wed May 24 15:21:43 2017
@@ -43,22 +43,20 @@ static apr_pool_t *p;
static volatile int counter;
typedef enum {TEST_GLOBAL, TEST_PROC} test_mode_e;
-static int lock_init(apr_lockmech_e mech, test_mode_e test_mode)
+static void lock_init(apr_lockmech_e mech, test_mode_e test_mode)
{
- apr_status_t rv;
if (test_mode == TEST_PROC) {
- rv = apr_proc_mutex_create(&proc_mutex,
- NULL,
- mech,
- p);
- }
- else {
- rv = apr_global_mutex_create(&global_mutex,
+ assert(apr_proc_mutex_create(&proc_mutex,
NULL,
mech,
- p);
+ p) == APR_SUCCESS);
+ }
+ else {
+ assert(apr_global_mutex_create(&global_mutex,
+ NULL,
+ mech,
+ p) == APR_SUCCESS);
}
- return rv;
}
static void lock_destroy(test_mode_e test_mode)
@@ -122,17 +120,7 @@ static void test_mech_mode(apr_lockmech_
assert(apr_thread_mutex_create(&thread_mutex, 0, p) == APR_SUCCESS);
assert(apr_thread_mutex_lock(thread_mutex) == APR_SUCCESS);
- rv = lock_init(mech, test_mode);
- if (rv != APR_SUCCESS) {
- char errmsg[256];
- printf("%s mutexes with mechanism `%s': %s\n",
- test_mode == TEST_GLOBAL ? "Global" : "Proc", mech_name,
- apr_strerror(rv, errmsg, sizeof errmsg));
- if (rv != APR_ENOTIMPL || mech == APR_LOCK_DEFAULT) {
- exit(1);
- }
- return;
- }
+ lock_init(mech, test_mode);
counter = 0;
@@ -154,7 +142,7 @@ static void test_mech_mode(apr_lockmech_
apr_sleep(apr_time_from_sec(5));
if (test_mode == TEST_PROC) {
- printf(" mutex mechanism `%s' is %sglobal in scope on this platform.\n",
+ printf(" Mutex mechanism `%s' is %sglobal in scope on this platform.\n",
mech_name, counter == 1 ? "" : "*NOT* ");
}
else {
@@ -167,7 +155,7 @@ static void test_mech_mode(apr_lockmech_
exit(1);
}
else {
- printf(" no problem encountered...\n");
+ printf(" no problems encountered...\n");
}
}
@@ -217,7 +205,6 @@ int main(void)
#if APR_HAS_PROC_PTHREAD_SERIALIZE
,{APR_LOCK_PROC_PTHREAD, "proc_pthread"}
#endif
- ,{APR_LOCK_DEFAULT_TIMED, "default_timed"}
};
int i;
Modified: apr/apr/branches/1.6.x/test/testprocmutex.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/test/testprocmutex.c?rev=1796072&r1=1796071&r2=1796072&view=diff
==============================================================================
--- apr/apr/branches/1.6.x/test/testprocmutex.c (original)
+++ apr/apr/branches/1.6.x/test/testprocmutex.c Wed May 24 15:21:43 2017
@@ -35,11 +35,6 @@
static apr_proc_mutex_t *proc_lock;
static volatile int *x;
-typedef struct lockmech {
- apr_lockmech_e num;
- const char *name;
-} lockmech_t;
-
/* a slower more racy way to implement (*x)++ */
static int increment(int n)
{
@@ -73,7 +68,7 @@ static void make_child(abts_case *tc, in
exit(1);
do {
- if (trylock > 0) {
+ if (trylock) {
int wait_usec = 0;
while ((rv = apr_proc_mutex_trylock(proc_lock))) {
@@ -84,16 +79,6 @@ static void make_child(abts_case *tc, in
apr_sleep(1);
}
}
- else if (trylock < 0) {
- int wait_usec = 0;
-
- while ((rv = apr_proc_mutex_timedlock(proc_lock, 1, 0))) {
- if (!APR_STATUS_IS_TIMEUP(rv))
- exit(1);
- if (++wait_usec >= MAX_WAIT_USEC)
- exit(1);
- }
- }
else {
if (apr_proc_mutex_lock(proc_lock))
exit(1);
@@ -123,21 +108,16 @@ static void await_child(abts_case *tc, a
}
static void test_exclusive(abts_case *tc, const char *lockname,
- lockmech_t *mech)
+ apr_lockmech_e mech)
{
apr_proc_t *child[CHILDREN];
apr_status_t rv;
int n;
- rv = apr_proc_mutex_create(&proc_lock, lockname, mech->num, p);
+ rv = apr_proc_mutex_create(&proc_lock, lockname, mech, p);
APR_ASSERT_SUCCESS(tc, "create the mutex", rv);
- if (rv != APR_SUCCESS) {
- fprintf(stderr, "%s not implemented, ", mech->name);
- ABTS_ASSERT(tc, "Default timed not implemented",
- mech->num != APR_LOCK_DEFAULT &&
- mech->num != APR_LOCK_DEFAULT_TIMED);
+ if (rv != APR_SUCCESS)
return;
- }
for (n = 0; n < CHILDREN; n++)
make_child(tc, 0, &child[n], p);
@@ -149,52 +129,24 @@ static void test_exclusive(abts_case *tc
rv = apr_proc_mutex_trylock(proc_lock);
if (rv == APR_ENOTIMPL) {
- fprintf(stderr, "%s_trylock() not implemented, ", mech->name);
- ABTS_ASSERT(tc, "Default timed trylock not implemented",
- mech->num != APR_LOCK_DEFAULT &&
- mech->num != APR_LOCK_DEFAULT_TIMED);
- }
- else {
- APR_ASSERT_SUCCESS(tc, "check for trylock", rv);
-
- rv = apr_proc_mutex_unlock(proc_lock);
- APR_ASSERT_SUCCESS(tc, "unlock after trylock check", rv);
-
- *x = 0;
-
- for (n = 0; n < CHILDREN; n++)
- make_child(tc, 1, &child[n], p);
-
- for (n = 0; n < CHILDREN; n++)
- await_child(tc, child[n]);
-
- ABTS_ASSERT(tc, "Locks don't appear to work with trylock",
- *x == MAX_COUNTER);
+ ABTS_NOT_IMPL(tc, "apr_proc_mutex_trylock not implemented");
+ return;
}
+ APR_ASSERT_SUCCESS(tc, "check for trylock", rv);
- rv = apr_proc_mutex_timedlock(proc_lock, 1, 0);
- if (rv == APR_ENOTIMPL) {
- fprintf(stderr, "%s_timedlock() not implemented, ", mech->name);
- ABTS_ASSERT(tc, "Default timed timedlock not implemented",
- mech->num != APR_LOCK_DEFAULT_TIMED);
- }
- else {
- APR_ASSERT_SUCCESS(tc, "check for timedlock", rv);
+ rv = apr_proc_mutex_unlock(proc_lock);
+ APR_ASSERT_SUCCESS(tc, "unlock after trylock check", rv);
- rv = apr_proc_mutex_unlock(proc_lock);
- APR_ASSERT_SUCCESS(tc, "unlock after timedlock check", rv);
+ *x = 0;
- *x = 0;
+ for (n = 0; n < CHILDREN; n++)
+ make_child(tc, 1, &child[n], p);
- for (n = 0; n < CHILDREN; n++)
- make_child(tc, -1, &child[n], p);
-
- for (n = 0; n < CHILDREN; n++)
- await_child(tc, child[n]);
-
- ABTS_ASSERT(tc, "Locks don't appear to work with timedlock",
- *x == MAX_COUNTER);
- }
+ for (n = 0; n < CHILDREN; n++)
+ await_child(tc, child[n]);
+
+ ABTS_ASSERT(tc, "Locks don't appear to work with trylock",
+ *x == MAX_COUNTER);
}
static void proc_mutex(abts_case *tc, void *data)
@@ -202,6 +154,7 @@ static void proc_mutex(abts_case *tc, vo
apr_status_t rv;
const char *shmname = "tpm.shm";
apr_shm_t *shm;
+ apr_lockmech_e *mech = data;
/* Use anonymous shm if available. */
rv = apr_shm_create(&shm, sizeof(int), NULL, p);
@@ -215,7 +168,7 @@ static void proc_mutex(abts_case *tc, vo
return;
x = apr_shm_baseaddr_get(shm);
- test_exclusive(tc, NULL, data);
+ test_exclusive(tc, NULL, *mech);
rv = apr_shm_destroy(shm);
APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv);
}
@@ -223,31 +176,31 @@ static void proc_mutex(abts_case *tc, vo
abts_suite *testprocmutex(abts_suite *suite)
{
- lockmech_t lockmechs[] = {
- {APR_LOCK_DEFAULT, "default"}
-#if APR_HAS_FLOCK_SERIALIZE
- ,{APR_LOCK_FLOCK, "flock"}
+ apr_lockmech_e mech = APR_LOCK_DEFAULT;
+
+ suite = ADD_SUITE(suite)
+ abts_run_test(suite, proc_mutex, &mech);
+#if APR_HAS_POSIXSEM_SERIALIZE
+ mech = APR_LOCK_POSIXSEM;
+ abts_run_test(suite, proc_mutex, &mech);
#endif
#if APR_HAS_SYSVSEM_SERIALIZE
- ,{APR_LOCK_SYSVSEM, "sysvsem"}
+ mech = APR_LOCK_SYSVSEM;
+ abts_run_test(suite, proc_mutex, &mech);
#endif
-#if APR_HAS_POSIXSEM_SERIALIZE
- ,{APR_LOCK_POSIXSEM, "posix"}
+#if APR_HAS_PROC_PTHREAD_SERIALIZE
+ mech = APR_LOCK_PROC_PTHREAD;
+ abts_run_test(suite, proc_mutex, &mech);
#endif
#if APR_HAS_FCNTL_SERIALIZE
- ,{APR_LOCK_FCNTL, "fcntl"}
+ mech = APR_LOCK_FCNTL;
+ abts_run_test(suite, proc_mutex, &mech);
#endif
-#if APR_HAS_PROC_PTHREAD_SERIALIZE
- ,{APR_LOCK_PROC_PTHREAD, "proc_pthread"}
+#if APR_HAS_FLOCK_SERIALIZE
+ mech = APR_LOCK_FLOCK;
+ abts_run_test(suite, proc_mutex, &mech);
#endif
- ,{APR_LOCK_DEFAULT_TIMED, "default_timed"}
- };
- int i;
- suite = ADD_SUITE(suite)
- for (i = 0; i < sizeof(lockmechs) / sizeof(lockmechs[0]); i++) {
- abts_run_test(suite, proc_mutex, &lockmechs[i]);
- }
return suite;
}