You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by tr...@apache.org on 2007/10/18 14:17:13 UTC
svn commit: r585937 - in /apr/apr/branches/1.2.x: CHANGES
atomic/os390/atomic.c
Author: trawick
Date: Thu Oct 18 05:17:12 2007
New Revision: 585937
URL: http://svn.apache.org/viewvc?rev=585937&view=rev
Log:
merge r585935 from trunk
Implement apr_atomic_casptr() for z/OS.
Submitted by: David Jones <oscaremma gmail.com>
Reviewed by: trawick
Modified:
apr/apr/branches/1.2.x/CHANGES
apr/apr/branches/1.2.x/atomic/os390/atomic.c
Modified: apr/apr/branches/1.2.x/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/CHANGES?rev=585937&r1=585936&r2=585937&view=diff
==============================================================================
--- apr/apr/branches/1.2.x/CHANGES [utf-8] (original)
+++ apr/apr/branches/1.2.x/CHANGES [utf-8] Thu Oct 18 05:17:12 2007
@@ -1,6 +1,9 @@
-*- coding: utf-8 -*-
Changes for APR 1.2.12
+ *) Implement apr_atomic_casptr() for z/OS.
+ [David Jones <oscaremma gmail.com>]
+
*) Fill in apr_fileinfo_t member st_csize on Netware and Unix (PR 41678),
and refine the file times down to apr_time_t resolution if supported
by a st_atimensec or st_atim.tv_nsec value by the OS. Additional
Modified: apr/apr/branches/1.2.x/atomic/os390/atomic.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/atomic/os390/atomic.c?rev=585937&r1=585936&r2=585937&view=diff
==============================================================================
--- apr/apr/branches/1.2.x/atomic/os390/atomic.c (original)
+++ apr/apr/branches/1.2.x/atomic/os390/atomic.c Thu Oct 18 05:17:12 2007
@@ -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 __cs1 failure */
+ mem_ptr, /* set from swap when __cs1 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 __csg 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;