You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by yl...@apache.org on 2022/01/12 12:51:05 UTC
svn commit: r1896960 - in /apr/apr/branches/1.7.x: ./ atomic/win32/apr_atomic64.c
Author: ylavic
Date: Wed Jan 12 12:51:04 2022
New Revision: 1896960
URL: http://svn.apache.org/viewvc?rev=1896960&view=rev
Log:
Merge r1896811 from trunk:
apr_atomic_set64: Follow up to r1868129.
Like for apr_atomic_read64() in r1868502, use direct memory write on x86_x64.
Submitted by: ylavic
Modified:
apr/apr/branches/1.7.x/ (props changed)
apr/apr/branches/1.7.x/atomic/win32/apr_atomic64.c
Propchange: apr/apr/branches/1.7.x/
------------------------------------------------------------------------------
Merged /apr/apr/trunk:r1896811
Modified: apr/apr/branches/1.7.x/atomic/win32/apr_atomic64.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.7.x/atomic/win32/apr_atomic64.c?rev=1896960&r1=1896959&r2=1896960&view=diff
==============================================================================
--- apr/apr/branches/1.7.x/atomic/win32/apr_atomic64.c (original)
+++ apr/apr/branches/1.7.x/atomic/win32/apr_atomic64.c Wed Jan 12 12:51:04 2022
@@ -46,7 +46,14 @@ APR_DECLARE(int) apr_atomic_dec64(volati
APR_DECLARE(void) apr_atomic_set64(volatile apr_uint64_t *mem, apr_uint64_t val)
{
+#if defined(_M_X64)
+ /* https://docs.microsoft.com/en-us/windows/win32/sync/interlocked-variable-access
+ * "Simple reads and writes to properly aligned 64-bit variables are atomic
+ * on 64-bit Windows."*/
+ *mem = val;
+#else
InterlockedExchange64((volatile LONG64 *)mem, val);
+#endif
}
APR_DECLARE(apr_uint64_t) apr_atomic_read64(volatile apr_uint64_t *mem)