From 39c207dc8c84ccbdc7d725cfad774b95fbddce2d Mon Sep 17 00:00:00 2001 From: tushicheng <18829573815@163.com> Date: Wed, 31 May 2023 02:42:20 +0000 Subject: [PATCH] fix the atomic operation when address misalignment --- deps/oblib/src/lib/thread/threads.h | 2 +- src/observer/ob_server.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deps/oblib/src/lib/thread/threads.h b/deps/oblib/src/lib/thread/threads.h index 783b7545f7..39ad3b39d8 100644 --- a/deps/oblib/src/lib/thread/threads.h +++ b/deps/oblib/src/lib/thread/threads.h @@ -140,7 +140,7 @@ private: int64_t stack_size_; bool stop_; // protect for thread count changing. - common::SpinRWLock lock_; + common::SpinRWLock lock_ __attribute__((__aligned__(16))); // tenant ctx IRunWrapper *run_wrapper_; // thread cgroups diff --git a/src/observer/ob_server.h b/src/observer/ob_server.h index 442ce73eb7..87205d984a 100644 --- a/src/observer/ob_server.h +++ b/src/observer/ob_server.h @@ -317,7 +317,7 @@ public: volatile bool need_ctas_cleanup_; //true: ObCTASCleanUpTask should traverse all table schemas to find the one need be dropped private: //thread to deal signals - char sig_buf_[sizeof(ObSignalWorker) + sizeof(ObSignalHandle)]; + char sig_buf_[sizeof(ObSignalWorker) + sizeof(ObSignalHandle)] __attribute__((__aligned__(16))); ObSignalWorker *sig_worker_; ObSignalHandle *signal_handle_;