Apache HTTPD
testatomic.c
Go to the documentation of this file.
1/* Licensed to the Apache Software Foundation (ASF) under one or more
2 * contributor license agreements. See the NOTICE file distributed with
3 * this work for additional information regarding copyright ownership.
4 * The ASF licenses this file to You under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include "testutil.h"
18#include "apr_strings.h"
19#include "apr_thread_proc.h"
20#include "apr_errno.h"
21#include "apr_general.h"
22#include "apr_atomic.h"
23#include "apr_time.h"
24
25/* Use pthread_setconcurrency where it is available and not a nullop,
26 * i.e. platforms using M:N or M:1 thread models: */
27#if APR_HAS_THREADS && \
28 ((defined(SOLARIS2) && SOLARIS2 > 6) || defined(_AIX))
29/* also HP-UX, IRIX? ... */
30#define HAVE_PTHREAD_SETCONCURRENCY
31#endif
32
33#ifdef HAVE_PTHREAD_SETCONCURRENCY
34#include <pthread.h>
35#endif
36
37static void test_init(abts_case *tc, void *data)
38{
39 APR_ASSERT_SUCCESS(tc, "Could not initliaze atomics", apr_atomic_init(p));
40}
41
42static void test_set32(abts_case *tc, void *data)
43{
46 ABTS_UINT_EQUAL(tc, 2, y32);
47}
48
49static void test_read32(abts_case *tc, void *data)
50{
54}
55
56static void test_dec32(abts_case *tc, void *data)
57{
59 int rv;
60
62
63 rv = apr_atomic_dec32(&y32);
64 ABTS_UINT_EQUAL(tc, 1, y32);
65 ABTS_ASSERT(tc, "atomic_dec returned zero when it shouldn't", rv != 0);
66
67 rv = apr_atomic_dec32(&y32);
68 ABTS_UINT_EQUAL(tc, 0, y32);
69 ABTS_ASSERT(tc, "atomic_dec didn't returned zero when it should", rv == 0);
70}
71
72static void test_xchg32(abts_case *tc, void *data)
73{
76
77 apr_atomic_set32(&y32, 100);
79
80 ABTS_UINT_EQUAL(tc, 100, oldval);
81 ABTS_UINT_EQUAL(tc, 50, y32);
82}
83
84static void test_xchgptr(abts_case *tc, void *data)
85{
86 int a;
87 void *ref = "little piggy";
88 volatile void *target_ptr = ref;
89 void *old_ptr;
90
92 ABTS_PTR_EQUAL(tc, ref, old_ptr);
93 ABTS_PTR_EQUAL(tc, (void *)&a, (void *)target_ptr);
94}
95
96static void test_cas_equal(abts_case *tc, void *data)
97{
100
101 oldval = apr_atomic_cas32(&casval, 12, 0);
102 ABTS_UINT_EQUAL(tc, 0, oldval);
103 ABTS_UINT_EQUAL(tc, 12, casval);
104}
105
106static void test_cas_equal_nonnull(abts_case *tc, void *data)
107{
108 apr_uint32_t casval = 12;
110
111 oldval = apr_atomic_cas32(&casval, 23, 12);
112 ABTS_UINT_EQUAL(tc, 12, oldval);
113 ABTS_UINT_EQUAL(tc, 23, casval);
114}
115
116static void test_cas_notequal(abts_case *tc, void *data)
117{
118 apr_uint32_t casval = 12;
120
121 oldval = apr_atomic_cas32(&casval, 23, 2);
122 ABTS_UINT_EQUAL(tc, 12, oldval);
123 ABTS_UINT_EQUAL(tc, 12, casval);
124}
125
126static void test_casptr_equal(abts_case *tc, void *data)
127{
128 int a = 0;
129 volatile void *target_ptr = NULL;
130 void *old_ptr;
131
134 ABTS_PTR_EQUAL(tc, (void *)&a, (void *)target_ptr);
135}
136
138{
139 int a = 0, b = 0;
140 volatile void *target_ptr = &a;
141 void *old_ptr;
142
144 ABTS_PTR_EQUAL(tc, (void *)&a, old_ptr);
145 ABTS_PTR_EQUAL(tc, (void *)&b, (void *)target_ptr);
146}
147
148static void test_casptr_notequal(abts_case *tc, void *data)
149{
150 int a = 0, b = 0;
151 volatile void *target_ptr = &a;
152 void *old_ptr;
153
155 ABTS_PTR_EQUAL(tc, (void *)&a, old_ptr);
156 ABTS_PTR_EQUAL(tc, (void *)&a, (void *)target_ptr);
157}
158
159static void test_add32(abts_case *tc, void *data)
160{
163
164 apr_atomic_set32(&y32, 23);
166 ABTS_UINT_EQUAL(tc, 23, oldval);
167 ABTS_UINT_EQUAL(tc, 27, y32);
168}
169
170static void test_add32_neg(abts_case *tc, void *data)
171{
174
175 apr_atomic_set32(&y32, 23);
176 oldval = apr_atomic_add32(&y32, -10);
177 ABTS_UINT_EQUAL(tc, 23, oldval);
178 ABTS_UINT_EQUAL(tc, 13, y32);
179}
180
181static void test_inc32(abts_case *tc, void *data)
182{
185
186 apr_atomic_set32(&y32, 23);
188 ABTS_UINT_EQUAL(tc, 23, oldval);
189 ABTS_UINT_EQUAL(tc, 24, y32);
190}
191
192static void test_set_add_inc_sub(abts_case *tc, void *data)
193{
195
197 apr_atomic_add32(&y32, 20);
199 apr_atomic_sub32(&y32, 10);
200
201 ABTS_UINT_EQUAL(tc, 11, y32);
202}
203
204static void test_wrap_zero(abts_case *tc, void *data)
205{
207 apr_uint32_t rv;
209 char *str;
210
212 rv = apr_atomic_dec32(&y32);
213
214 ABTS_ASSERT(tc, "apr_atomic_dec32 on zero returned zero.", rv != 0);
215 str = apr_psprintf(p, "zero wrap failed: 0 - 1 = %d", y32);
216 ABTS_ASSERT(tc, str, y32 == minus1);
217}
218
219static void test_inc_neg1(abts_case *tc, void *data)
220{
223 apr_uint32_t rv;
224 char *str;
225
226 rv = apr_atomic_inc32(&y32);
227
228 ABTS_ASSERT(tc, "apr_atomic_inc32 didn't return the old value.", rv == minus1);
229 str = apr_psprintf(p, "zero wrap failed: -1 + 1 = %d", y32);
230 ABTS_ASSERT(tc, str, y32 == 0);
231}
232
233static void test_set64(abts_case *tc, void *data)
234{
237 ABTS_ULLONG_EQUAL(tc, 2, y64);
238}
239
240static void test_read64(abts_case *tc, void *data)
241{
245}
246
247static void test_dec64(abts_case *tc, void *data)
248{
250 int rv;
251
253
254 rv = apr_atomic_dec64(&y64);
255 ABTS_ULLONG_EQUAL(tc, 1, y64);
256 ABTS_ASSERT(tc, "atomic_dec returned zero when it shouldn't", rv != 0);
257
258 rv = apr_atomic_dec64(&y64);
259 ABTS_ULLONG_EQUAL(tc, 0, y64);
260 ABTS_ASSERT(tc, "atomic_dec didn't returned zero when it should", rv == 0);
261}
262
263static void test_xchg64(abts_case *tc, void *data)
264{
267
268 apr_atomic_set64(&y64, 100);
270
271 ABTS_ULLONG_EQUAL(tc, 100, oldval);
272 ABTS_ULLONG_EQUAL(tc, 50, y64);
273}
274
275static void test_add64(abts_case *tc, void *data)
276{
279
280 apr_atomic_set64(&y64, 23);
282 ABTS_ULLONG_EQUAL(tc, 23, oldval);
283 ABTS_ULLONG_EQUAL(tc, 27, y64);
284}
285
286static void test_add64_neg(abts_case *tc, void *data)
287{
290
291 apr_atomic_set64(&y64, 23);
292 oldval = apr_atomic_add64(&y64, -10);
293 ABTS_ULLONG_EQUAL(tc, 23, oldval);
294 ABTS_ULLONG_EQUAL(tc, 13, y64);
295}
296
297static void test_inc64(abts_case *tc, void *data)
298{
301
302 apr_atomic_set64(&y64, 23);
304 ABTS_ULLONG_EQUAL(tc, 23, oldval);
305 ABTS_ULLONG_EQUAL(tc, 24, y64);
306}
307
308static void test_set_add_inc_sub64(abts_case *tc, void *data)
309{
311
313 apr_atomic_add64(&y64, 20);
315 apr_atomic_sub64(&y64, 10);
316
317 ABTS_ULLONG_EQUAL(tc, 11, y64);
318}
319
320static void test_wrap_zero64(abts_case *tc, void *data)
321{
323 apr_uint64_t rv;
325 char *str;
326
328 rv = apr_atomic_dec64(&y64);
329
330 ABTS_ASSERT(tc, "apr_atomic_dec64 on zero returned zero.", rv != 0);
331 str = apr_psprintf(p, "zero wrap failed: 0 - 1 = %lu", y64);
332 ABTS_ASSERT(tc, str, y64 == minus1);
333}
334
335static void test_inc_neg164(abts_case *tc, void *data)
336{
339 apr_uint64_t rv;
340 char *str;
341
342 rv = apr_atomic_inc64(&y64);
343
344 ABTS_ASSERT(tc, "apr_atomic_inc64 didn't return the old value.", rv == minus1);
345 str = apr_psprintf(p, "zero wrap failed: -1 + 1 = %lu", y64);
346 ABTS_ASSERT(tc, str, y64 == 0);
347}
348
349
350#if APR_HAS_THREADS
351
356
363#ifndef CACHELINE_SIZE
364#define CACHELINE_SIZE 64
365#endif
366struct {
367 char pad[CACHELINE_SIZE - 5];
370
371apr_status_t exit_ret_val = 123; /* just some made up number to check on later */
372
373#define NUM_THREADS 40
374#define NUM_ITERATIONS 20000
375
377{
378 int i;
379
380 for (i = 0; i < NUM_ITERATIONS; i++) {
382 mutex_locks++;
384 }
386 return NULL;
387}
388
390{
391 int i;
392
393 for (i = 0; i < NUM_ITERATIONS ; i++) {
398 }
400 return NULL;
401}
402
403static void test_atomics_threaded(abts_case *tc, void *data)
404{
407 apr_status_t rv;
408 int i;
409
410#ifdef HAVE_PTHREAD_SETCONCURRENCY
412#endif
413
415 APR_ASSERT_SUCCESS(tc, "Could not create lock", rv);
416
417 for (i = 0; i < NUM_THREADS; i++) {
421 ABTS_ASSERT(tc, "Failed creating threads", !r1 && !r2);
422 }
423
424 for (i = 0; i < NUM_THREADS; i++) {
428
429 ABTS_ASSERT(tc, "Invalid return value from thread_join",
430 s1 == exit_ret_val && s2 == exit_ret_val);
431 }
432
436
438 ABTS_ASSERT(tc, "Failed creating threads", rv == APR_SUCCESS);
439}
440
441#undef NUM_THREADS
442#define NUM_THREADS 7
443
444typedef struct tbox_t tbox_t;
445typedef struct tbox_t64 tbox_t64;
446
447struct tbox_t {
448 abts_case *tc;
453 void (*func)(tbox_t *box);
454};
455
457{
459
460 do {
461 val = apr_atomic_read32(tbox->mem);
462
463 if (val != tbox->preval)
465 else
466 break;
467 } while (1);
468}
469
470static void busyloop_set32(tbox_t *tbox)
471{
472 do {
474 apr_atomic_set32(tbox->mem, tbox->postval);
475 } while (--tbox->loop);
476}
477
478static void busyloop_add32(tbox_t *tbox)
479{
481
482 do {
484 val = apr_atomic_add32(tbox->mem, tbox->postval);
486 ABTS_UINT_EQUAL(tbox->tc, val, tbox->preval);
488 } while (--tbox->loop);
489}
490
491static void busyloop_sub32(tbox_t *tbox)
492{
493 do {
495 apr_atomic_sub32(tbox->mem, tbox->postval);
496 } while (--tbox->loop);
497}
498
499static void busyloop_inc32(tbox_t *tbox)
500{
502
503 do {
505 val = apr_atomic_inc32(tbox->mem);
507 ABTS_UINT_EQUAL(tbox->tc, val, tbox->preval);
509 } while (--tbox->loop);
510}
511
512static void busyloop_dec32(tbox_t *tbox)
513{
515
516 do {
518 val = apr_atomic_dec32(tbox->mem);
520 ABTS_UINT_NEQUAL(tbox->tc, 0, val);
522 } while (--tbox->loop);
523}
524
525static void busyloop_cas32(tbox_t *tbox)
526{
528
529 do {
530 do {
531 val = apr_atomic_cas32(tbox->mem, tbox->postval, tbox->preval);
532
533 if (val != tbox->preval)
535 else
536 break;
537 } while (1);
538 } while (--tbox->loop);
539}
540
541static void busyloop_xchg32(tbox_t *tbox)
542{
544
545 do {
547 val = apr_atomic_xchg32(tbox->mem, tbox->postval);
549 ABTS_UINT_EQUAL(tbox->tc, val, tbox->preval);
551 } while (--tbox->loop);
552}
553
555{
556 tbox_t *tbox = data;
557
558 tbox->func(tbox);
559
561
562 return NULL;
563}
564
565static void test_atomics_busyloop_threaded(abts_case *tc, void *data)
566{
567 unsigned int i;
568 apr_status_t rv;
571 apr_thread_t *thread[NUM_THREADS];
572
574 APR_ASSERT_SUCCESS(tc, "Could not create lock", rv);
575
576 /* get ready */
577 for (i = 0; i < NUM_THREADS; i++) {
578 tbox[i].tc = tc;
579 tbox[i].mem = &count;
580 tbox[i].loop = 50;
581 }
582
583 tbox[0].preval = 98;
584 tbox[0].postval = 3891;
585 tbox[0].func = busyloop_add32;
586
587 tbox[1].preval = 3989;
588 tbox[1].postval = 1010;
589 tbox[1].func = busyloop_sub32;
590
591 tbox[2].preval = 2979;
592 tbox[2].postval = 0; /* not used */
593 tbox[2].func = busyloop_inc32;
594
595 tbox[3].preval = 2980;
596 tbox[3].postval = 16384;
597 tbox[3].func = busyloop_set32;
598
599 tbox[4].preval = 16384;
600 tbox[4].postval = 0; /* not used */
601 tbox[4].func = busyloop_dec32;
602
603 tbox[5].preval = 16383;
604 tbox[5].postval = 1048576;
605 tbox[5].func = busyloop_cas32;
606
607 tbox[6].preval = 1048576;
608 tbox[6].postval = 98; /* goto tbox[0] */
609 tbox[6].func = busyloop_xchg32;
610
611 /* get set */
612 for (i = 0; i < NUM_THREADS; i++) {
614 &tbox[i], p);
615 ABTS_ASSERT(tc, "Failed creating thread", rv == APR_SUCCESS);
616 }
617
618 /* go! */
619 apr_atomic_set32(tbox->mem, 98);
620
621 for (i = 0; i < NUM_THREADS; i++) {
623 rv = apr_thread_join(&retval, thread[i]);
624 ABTS_ASSERT(tc, "Thread join failed", rv == APR_SUCCESS);
625 ABTS_ASSERT(tc, "Invalid return value from thread_join", retval == 0);
626 }
627
628 ABTS_UINT_EQUAL(tbox->tc, 98, count);
629
631 ABTS_ASSERT(tc, "Failed creating threads", rv == APR_SUCCESS);
632}
633
635{
636 int i;
637
638 for (i = 0; i < NUM_ITERATIONS; i++) {
642 }
644 return NULL;
645}
646
647
649{
651 int i;
652
653 for (i = 0; i < NUM_ITERATIONS ; i++) {
658 }
660 return NULL;
661}
662
663static void test_atomics_threaded64(abts_case *tc, void *data)
664{
668 apr_status_t rv;
669 int i;
670
671#ifdef HAVE_PTHREAD_SETCONCURRENCY
673#endif
674
675 mutex_locks64 = 0;
677
679 APR_ASSERT_SUCCESS(tc, "Could not create lock", rv);
680
681 for (i = 0; i < NUM_THREADS; i++) {
685 ABTS_ASSERT(tc, "Failed creating threads", !r1 && !r2);
686 }
687
688 for (i = 0; i < NUM_THREADS; i++) {
692
693 ABTS_ASSERT(tc, "Invalid return value from thread_join",
694 s1 == exit_ret_val && s2 == exit_ret_val);
695 }
696
700
702 ABTS_ASSERT(tc, "Failed creating threads", rv == APR_SUCCESS);
703}
704
705struct tbox_t64 {
706 abts_case *tc;
711 void (*func)(tbox_t64 *box);
712};
713
715{
717
718 do {
719 val = apr_atomic_read64(tbox->mem);
720
721 if (val != tbox->preval)
723 else
724 break;
725 } while (1);
726}
727
728static void busyloop_set64(tbox_t64 *tbox)
729{
730 do {
732 apr_atomic_set64(tbox->mem, tbox->postval);
733 } while (--tbox->loop);
734}
735
736static void busyloop_add64(tbox_t64 *tbox)
737{
739
740 do {
742 val = apr_atomic_add64(tbox->mem, tbox->postval);
744 ABTS_ULLONG_EQUAL(tbox->tc, val, tbox->preval);
746 } while (--tbox->loop);
747}
748
749static void busyloop_sub64(tbox_t64 *tbox)
750{
751 do {
753 apr_atomic_sub64(tbox->mem, tbox->postval);
754 } while (--tbox->loop);
755}
756
757static void busyloop_inc64(tbox_t64 *tbox)
758{
760
761 do {
763 val = apr_atomic_inc64(tbox->mem);
765 ABTS_ULLONG_EQUAL(tbox->tc, val, tbox->preval);
767 } while (--tbox->loop);
768}
769
770static void busyloop_dec64(tbox_t64 *tbox)
771{
773
774 do {
776 val = apr_atomic_dec64(tbox->mem);
778 ABTS_ULLONG_NEQUAL(tbox->tc, 0, val);
780 } while (--tbox->loop);
781}
782
783static void busyloop_cas64(tbox_t64 *tbox)
784{
786
787 do {
788 do {
789 val = apr_atomic_cas64(tbox->mem, tbox->postval, tbox->preval);
790
791 if (val != tbox->preval)
793 else
794 break;
795 } while (1);
796 } while (--tbox->loop);
797}
798
799static void busyloop_xchg64(tbox_t64 *tbox)
800{
802
803 do {
805 val = apr_atomic_xchg64(tbox->mem, tbox->postval);
807 ABTS_ULLONG_EQUAL(tbox->tc, val, tbox->preval);
809 } while (--tbox->loop);
810}
811
813{
814 tbox_t64 *tbox = data;
815
816 tbox->func(tbox);
817
819
820 return NULL;
821}
822
823static void test_atomics_busyloop_threaded64(abts_case *tc, void *data)
824{
825 unsigned int i;
826 apr_status_t rv;
829 apr_thread_t *thread[NUM_THREADS];
830
832 APR_ASSERT_SUCCESS(tc, "Could not create lock", rv);
833
834 /* get ready */
835 for (i = 0; i < NUM_THREADS; i++) {
836 tbox[i].tc = tc;
837 tbox[i].mem = &count;
838 tbox[i].loop = 50;
839 }
840
841 tbox[0].preval = 98;
842 tbox[0].postval = 3891;
843 tbox[0].func = busyloop_add64;
844
845 tbox[1].preval = 3989;
846 tbox[1].postval = 1010;
847 tbox[1].func = busyloop_sub64;
848
849 tbox[2].preval = 2979;
850 tbox[2].postval = 0; /* not used */
851 tbox[2].func = busyloop_inc64;
852
853 tbox[3].preval = 2980;
854 tbox[3].postval = 16384;
855 tbox[3].func = busyloop_set64;
856
857 tbox[4].preval = 16384;
858 tbox[4].postval = 0; /* not used */
859 tbox[4].func = busyloop_dec64;
860
861 tbox[5].preval = 16383;
862 tbox[5].postval = 1048576;
863 tbox[5].func = busyloop_cas64;
864
865 tbox[6].preval = 1048576;
866 tbox[6].postval = 98; /* goto tbox[0] */
867 tbox[6].func = busyloop_xchg64;
868
869 /* get set */
870 for (i = 0; i < NUM_THREADS; i++) {
872 &tbox[i], p);
873 ABTS_ASSERT(tc, "Failed creating thread", rv == APR_SUCCESS);
874 }
875
876 /* go! */
877 apr_atomic_set64(tbox->mem, 98);
878
879 for (i = 0; i < NUM_THREADS; i++) {
881 rv = apr_thread_join(&retval, thread[i]);
882 ABTS_ASSERT(tc, "Thread join failed", rv == APR_SUCCESS);
883 ABTS_ASSERT(tc, "Invalid return value from thread_join", retval == 0);
884 }
885
886 ABTS_ULLONG_EQUAL(tbox->tc, 98, count);
887
889 ABTS_ASSERT(tc, "Failed creating threads", rv == APR_SUCCESS);
890}
891
893{
895 int i;
896
897 for (i = 0; i < 1000 * 1000; i++) {
898 apr_atomic_set64(ops64, APR_UINT64_C(0x1111222233334444));
899 apr_atomic_set64(ops64, APR_UINT64_C(0x4444555566667777));
900 }
901
903 return NULL;
904}
905
906static void test_atomics_threaded_setread64(abts_case *tc, void *data)
907{
909 apr_thread_t *thread;
911 int i;
912
913 apr_atomic_set64(ops64, APR_UINT64_C(0x1111222233334444));
914
916
917 for (i = 0; i < 1000 * 1000 * 2; i++) {
919
920 if (val != APR_UINT64_C(0x1111222233334444) &&
921 val != APR_UINT64_C(0x4444555566667777))
922 {
923 ABTS_FAIL(tc, "Unexpected value");
924 break;
925 }
926 }
927
928 apr_thread_join(&retval, thread);
929}
930
931#endif /* !APR_HAS_THREADS */
932
934{
935 suite = ADD_SUITE(suite)
936
965
966#if APR_HAS_THREADS
974#endif
975
976 return suite;
977}
978
void abts_run_test(abts_suite *ts, test_func f, void *value)
Definition abts.c:175
#define ABTS_PTR_EQUAL(a, b, c)
Definition abts.h:126
#define ADD_SUITE(suite)
Definition abts.h:67
#define ABTS_UINT_EQUAL(a, b, c)
Definition abts.h:111
#define ABTS_ULLONG_NEQUAL(a, b, c)
Definition abts.h:120
#define ABTS_ULLONG_EQUAL(a, b, c)
Definition abts.h:119
#define ABTS_ASSERT(a, b, c)
Definition abts.h:130
#define ABTS_FAIL(a, b)
Definition abts.h:128
#define ABTS_UINT_NEQUAL(a, b, c)
Definition abts.h:112
#define APR_ASSERT_SUCCESS(tc, ctxt, rv)
Definition testutil.h:58
APR Atomic Operations.
APR Error Codes.
APR Miscellaneous library routines.
APR Strings library.
APR Thread and Process Library.
APR Time Library.
apr_uint32_t apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val)
Definition atomic.c:30
void apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val)
Definition atomic.c:41
apr_uint32_t apr_atomic_inc32(volatile apr_uint32_t *mem)
Definition atomic.c:51
apr_uint32_t apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val)
Definition atomic.c:111
int apr_atomic_dec32(volatile apr_uint32_t *mem)
Definition atomic.c:56
apr_status_t apr_atomic_init(apr_pool_t *p)
Definition atomic.c:21
void apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val)
Definition atomic.c:73
apr_uint32_t apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t swap, apr_uint32_t cmp)
Definition atomic.c:78
apr_uint32_t apr_atomic_read32(volatile apr_uint32_t *mem)
Definition atomic.c:68
void apr_thread_yield()
Definition thread.c:161
unsigned int count
Definition apr_md5.h:152
apr_bucket apr_bucket_brigade * a
apr_size_t size
apr_uint32_t val
Definition apr_atomic.h:66
#define APR_SUCCESS
Definition apr_errno.h:225
int apr_status_t
Definition apr_errno.h:44
void * data
apr_interval_time_t apr_pollcb_cb_t func
Definition apr_poll.h:422
apr_pool_t * b
Definition apr_pools.h:529
const char apr_status_t(*) apr_pool_t *poo __attribute__)((nonnull(2, 4)))
Definition apr_pools.h:567
void * mem
apr_pool_t * p
Definition md_event.c:32
return NULL
Definition mod_so.c:359
int i
Definition mod_so.c:347
apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t retval)
Definition thread.c:157
apr_status_t apr_thread_join(apr_status_t *retval, apr_thread_t *thd)
Definition thread.c:166
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)
Definition thread.c:73
static void test_set32(abts_case *tc, void *data)
Definition testatomic.c:42
static void test_casptr_equal(abts_case *tc, void *data)
Definition testatomic.c:126
static void test_inc_neg164(abts_case *tc, void *data)
Definition testatomic.c:335
static void test_set64(abts_case *tc, void *data)
Definition testatomic.c:233
static void test_add64(abts_case *tc, void *data)
Definition testatomic.c:275
static void test_wrap_zero(abts_case *tc, void *data)
Definition testatomic.c:204
static void test_wrap_zero64(abts_case *tc, void *data)
Definition testatomic.c:320
static void test_inc64(abts_case *tc, void *data)
Definition testatomic.c:297
abts_suite * testatomic(abts_suite *suite)
Definition testatomic.c:933
static void test_init(abts_case *tc, void *data)
Definition testatomic.c:37
static void test_cas_equal_nonnull(abts_case *tc, void *data)
Definition testatomic.c:106
static void test_add32(abts_case *tc, void *data)
Definition testatomic.c:159
static void test_casptr_notequal(abts_case *tc, void *data)
Definition testatomic.c:148
static void test_add64_neg(abts_case *tc, void *data)
Definition testatomic.c:286
static void test_inc32(abts_case *tc, void *data)
Definition testatomic.c:181
static void test_set_add_inc_sub64(abts_case *tc, void *data)
Definition testatomic.c:308
static void test_read32(abts_case *tc, void *data)
Definition testatomic.c:49
static void test_dec32(abts_case *tc, void *data)
Definition testatomic.c:56
static void test_inc_neg1(abts_case *tc, void *data)
Definition testatomic.c:219
static void test_xchg64(abts_case *tc, void *data)
Definition testatomic.c:263
static void test_read64(abts_case *tc, void *data)
Definition testatomic.c:240
static void test_cas_equal(abts_case *tc, void *data)
Definition testatomic.c:96
static void test_xchg32(abts_case *tc, void *data)
Definition testatomic.c:72
static void test_set_add_inc_sub(abts_case *tc, void *data)
Definition testatomic.c:192
static void test_casptr_equal_nonnull(abts_case *tc, void *data)
Definition testatomic.c:137
static void test_xchgptr(abts_case *tc, void *data)
Definition testatomic.c:84
static void test_add32_neg(abts_case *tc, void *data)
Definition testatomic.c:170
static void test_cas_notequal(abts_case *tc, void *data)
Definition testatomic.c:116
static void test_dec64(abts_case *tc, void *data)
Definition testatomic.c:247
static apr_table_t * t1
Definition testtable.c:34
#define str