Skip to content

Commit

Permalink
MDEV-6450 - MariaDB crash on Power8 when built with advance
Browse files Browse the repository at this point in the history
            tool chain

This is an addition to the original patch. On Windows
InterlockedExchange implies full memory barrier, whereas
only acquire/release barriers required.
  • Loading branch information
svoj committed Jul 31, 2014
1 parent a40be4c commit 53360fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions storage/innobase/include/os0sync.h
Original file line number Diff line number Diff line change
Expand Up @@ -638,13 +638,13 @@ InterlockedExchange() operates on LONG, and the LONG will be
clobbered */

# define os_atomic_test_and_set_byte(ptr, new_val) \
((byte) InterlockedExchange(ptr, new_val))
((byte) InterlockedExchangeAcquire(ptr, new_val))

# define os_atomic_test_and_set_ulong(ptr, new_val) \
InterlockedExchange(ptr, new_val)
InterlockedExchangeAcquire(ptr, new_val)

# define os_atomic_lock_release_byte(ptr) \
(void) InterlockedExchange(ptr, 0)
(void) InterlockedAndRelease(ptr, 0)

#else
# define IB_ATOMICS_STARTUP_MSG \
Expand Down
6 changes: 3 additions & 3 deletions storage/xtradb/include/os0sync.h
Original file line number Diff line number Diff line change
Expand Up @@ -638,13 +638,13 @@ InterlockedExchange() operates on LONG, and the LONG will be
clobbered */

# define os_atomic_test_and_set_byte(ptr, new_val) \
((byte) InterlockedExchange(ptr, new_val))
((byte) InterlockedExchangeAcquire(ptr, new_val))

# define os_atomic_test_and_set_ulong(ptr, new_val) \
InterlockedExchange(ptr, new_val)
InterlockedExchangeAcquire(ptr, new_val)

# define os_atomic_lock_release_byte(ptr) \
(void) InterlockedExchange(ptr, 0)
(void) InterlockedAndRelease(ptr, 0)

#else
# define IB_ATOMICS_STARTUP_MSG \
Expand Down

0 comments on commit 53360fd

Please sign in to comment.