27#if APR_HAS_THREADS && \
28 ((defined(SOLARIS2) && SOLARIS2 > 6) || defined(_AIX))
30#define HAVE_PTHREAD_SETCONCURRENCY
33#ifdef HAVE_PTHREAD_SETCONCURRENCY
65 ABTS_ASSERT(tc,
"atomic_dec returned zero when it shouldn't", rv != 0);
69 ABTS_ASSERT(tc,
"atomic_dec didn't returned zero when it should", rv == 0);
87 void *ref =
"little piggy";
214 ABTS_ASSERT(tc,
"apr_atomic_dec32 on zero returned zero.", rv != 0);
256 ABTS_ASSERT(tc,
"atomic_dec returned zero when it shouldn't", rv != 0);
260 ABTS_ASSERT(tc,
"atomic_dec didn't returned zero when it should", rv == 0);
330 ABTS_ASSERT(tc,
"apr_atomic_dec64 on zero returned zero.", rv != 0);
363#ifndef CACHELINE_SIZE
364#define CACHELINE_SIZE 64
373#define NUM_THREADS 40
374#define NUM_ITERATIONS 20000
410#ifdef HAVE_PTHREAD_SETCONCURRENCY
429 ABTS_ASSERT(tc,
"Invalid return value from thread_join",
475 }
while (--
tbox->loop);
488 }
while (--
tbox->loop);
496 }
while (--
tbox->loop);
509 }
while (--
tbox->loop);
522 }
while (--
tbox->loop);
538 }
while (--
tbox->loop);
551 }
while (--
tbox->loop);
584 tbox[0].postval = 3891;
587 tbox[1].preval = 3989;
588 tbox[1].postval = 1010;
591 tbox[2].preval = 2979;
595 tbox[3].preval = 2980;
596 tbox[3].postval = 16384;
599 tbox[4].preval = 16384;
603 tbox[5].preval = 16383;
604 tbox[5].postval = 1048576;
607 tbox[6].preval = 1048576;
608 tbox[6].postval = 98;
671#ifdef HAVE_PTHREAD_SETCONCURRENCY
693 ABTS_ASSERT(tc,
"Invalid return value from thread_join",
733 }
while (--
tbox->loop);
746 }
while (--
tbox->loop);
754 }
while (--
tbox->loop);
767 }
while (--
tbox->loop);
780 }
while (--
tbox->loop);
796 }
while (--
tbox->loop);
809 }
while (--
tbox->loop);
842 tbox[0].postval = 3891;
845 tbox[1].preval = 3989;
846 tbox[1].postval = 1010;
849 tbox[2].preval = 2979;
853 tbox[3].preval = 2980;
854 tbox[3].postval = 16384;
857 tbox[4].preval = 16384;
861 tbox[5].preval = 16383;
862 tbox[5].postval = 1048576;
865 tbox[6].preval = 1048576;
866 tbox[6].postval = 98;
897 for (
i = 0;
i < 1000 * 1000;
i++) {
917 for (
i = 0;
i < 1000 * 1000 * 2;
i++) {
void abts_run_test(abts_suite *ts, test_func f, void *value)
#define ABTS_PTR_EQUAL(a, b, c)
#define ABTS_UINT_EQUAL(a, b, c)
#define ABTS_ULLONG_NEQUAL(a, b, c)
#define ABTS_ULLONG_EQUAL(a, b, c)
#define ABTS_ASSERT(a, b, c)
#define ABTS_UINT_NEQUAL(a, b, c)
#define APR_ASSERT_SUCCESS(tc, ctxt, rv)
APR Miscellaneous library routines.
APR Thread and Process Library.
apr_uint32_t apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val)
void apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val)
apr_uint32_t apr_atomic_inc32(volatile apr_uint32_t *mem)
apr_uint32_t apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val)
int apr_atomic_dec32(volatile apr_uint32_t *mem)
apr_status_t apr_atomic_init(apr_pool_t *p)
void apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val)
apr_uint32_t apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t swap, apr_uint32_t cmp)
apr_uint32_t apr_atomic_read32(volatile apr_uint32_t *mem)
apr_bucket apr_bucket_brigade * a
apr_interval_time_t apr_pollcb_cb_t func
const char apr_status_t(*) apr_pool_t *poo __attribute__)((nonnull(2, 4)))
apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t retval)
apr_status_t apr_thread_join(apr_status_t *retval, apr_thread_t *thd)
apr_status_t apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, apr_thread_start_t func, void *data, apr_pool_t *pool)
static void test_set32(abts_case *tc, void *data)
static void test_casptr_equal(abts_case *tc, void *data)
static void test_inc_neg164(abts_case *tc, void *data)
static void test_set64(abts_case *tc, void *data)
static void test_add64(abts_case *tc, void *data)
static void test_wrap_zero(abts_case *tc, void *data)
static void test_wrap_zero64(abts_case *tc, void *data)
static void test_inc64(abts_case *tc, void *data)
abts_suite * testatomic(abts_suite *suite)
static void test_init(abts_case *tc, void *data)
static void test_cas_equal_nonnull(abts_case *tc, void *data)
static void test_add32(abts_case *tc, void *data)
static void test_casptr_notequal(abts_case *tc, void *data)
static void test_add64_neg(abts_case *tc, void *data)
static void test_inc32(abts_case *tc, void *data)
static void test_set_add_inc_sub64(abts_case *tc, void *data)
static void test_read32(abts_case *tc, void *data)
static void test_dec32(abts_case *tc, void *data)
static void test_inc_neg1(abts_case *tc, void *data)
static void test_xchg64(abts_case *tc, void *data)
static void test_read64(abts_case *tc, void *data)
static void test_cas_equal(abts_case *tc, void *data)
static void test_xchg32(abts_case *tc, void *data)
static void test_set_add_inc_sub(abts_case *tc, void *data)
static void test_casptr_equal_nonnull(abts_case *tc, void *data)
static void test_xchgptr(abts_case *tc, void *data)
static void test_add32_neg(abts_case *tc, void *data)
static void test_cas_notequal(abts_case *tc, void *data)
static void test_dec64(abts_case *tc, void *data)