Create a z/OS implementation of apr_atomic_casptr. Note: we don't need the -enable-nonportable-atomics flag as the atomic/os390 directory implementations will always be used first if they exist
Passes apr/test/testatomic at 1.2.x level, which includes:
Revision
*582493*<http://svn.apache.org/viewvc?view=rev&revision=582493>- (
view<http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/test/testatomic.c?revision=582493&view=markup>)
(download<http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/test/testatomic.c?revision=582493>)
(annotate<http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/test/testatomic.c?annotate=582493>)
- [select for
diffs]<http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/test/testatomic.c?r1=582493&view=log>
Modified *Sat Oct 6 12:46:08 2007 UTC* (3 days, 5 hours ago) by *trawick*
File length: 9659 byte(s)
Diff to previous
428331<http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/test/testatomic.c?r1=428331&r2=582493>(
colored<http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/test/testatomic.c?r1=428331&r2=582493&diff_format=h>)
merge r505091 and r552360 from trunk
r505091: add a test for apr_atomic_casptr, used in the
httpd worker and event MPMs
Passes apr/test/testatomic at trunk, at 554294 level, which does not include
the following test of apr_atomic_xchgptr (which does not yet have a zOS
implementation, but is also not in httpd 2.2.6):
Revision
*554995*<http://svn.apache.org/viewvc?view=rev&revision=554995>- (
view<http://svn.apache.org/viewvc/apr/apr/trunk/test/testatomic.c?revision=554995&view=markup>)
(download<http://svn.apache.org/viewvc/apr/apr/trunk/test/testatomic.c?revision=554995>)
(annotate<http://svn.apache.org/viewvc/apr/apr/trunk/test/testatomic.c?annotate=554995>)
- [select for
diffs]<http://svn.apache.org/viewvc/apr/apr/trunk/test/testatomic.c?r1=554995&view=log>
Modified *Tue Jul 10 16:35:45 2007 UTC* (2 months, 4 weeks ago) by *davi*
File length: 13674 byte(s)
Diff to previous
554294<http://svn.apache.org/viewvc/apr/apr/trunk/test/testatomic.c?r1=554294&r2=554995>(
colored<http://svn.apache.org/viewvc/apr/apr/trunk/test/testatomic.c?r1=554294&r2=554995&diff_format=h>)
Introduce apr_atomic_xchgptr, which atomically exchanges a pair of pointer
values. Missing OS/390 implementation.
Index: atomic/os390/atomic.c
===================================================================
--- atomic/os390/atomic.c (revision 583255)
+++ atomic/os390/atomic.c (working copy)
@@ -82,6 +82,30 @@
return old; /* old is automatically updated from mem on cs failure */
}
+#if APR_SIZEOF_VOIDP == 4
+void *apr_atomic_casptr(volatile void **mem_ptr,
+ void *swap_ptr,
+ const void *cmp_ptr )
+{
+ __cs1 (&cmp_ptr, /* automatically updated from mem on __cds1
failure */
+ mem_ptr, /* set from swap when __cds1
succeeds */
+ &swap_ptr);
+ return (void *)cmp_ptr;
+}
+#elif APR_SIZEOF_VOIDP == 8
+void *apr_atomic_casptr(volatile void **mem_ptr,
+ void *swap_ptr,
+ const void *cmp_ptr )
+{
+ __csg (&cmp_ptr, /* automatically updated from mem on __cds1
failure */
+ mem_ptr, /* set from swap when __csg
succeeds */
+ &swap_ptr);
+ return (void *)cmp_ptr;
+}
+#else
+#error APR_SIZEOF_VOIDP value not supported
+#endif /* APR_SIZEOF_VOIDP */
+
apr_uint32_t apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t
val)
{
apr_uint32_t old, new_val;
atomic.patch
Description: Binary data
