You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-01 06:46:55 +03:00
clang format apply
This commit is contained in:
@ -4,24 +4,23 @@
|
||||
|
||||
namespace utils
|
||||
{
|
||||
|
||||
inline void getSpinlock(std::atomic<bool> &lock)
|
||||
inline void getSpinlock(std::atomic<bool>& lock)
|
||||
{
|
||||
bool _false = false;
|
||||
while (!lock.compare_exchange_weak(_false, true, std::memory_order_acquire))
|
||||
_false = false;
|
||||
bool _false = false;
|
||||
while (!lock.compare_exchange_weak(_false, true, std::memory_order_acquire))
|
||||
_false = false;
|
||||
}
|
||||
|
||||
inline bool trySpinlock(std::atomic<bool> &lock)
|
||||
inline bool trySpinlock(std::atomic<bool>& lock)
|
||||
{
|
||||
bool _false = false;
|
||||
bool ret = lock.compare_exchange_weak(_false, true, std::memory_order_acquire);
|
||||
return ret;
|
||||
bool _false = false;
|
||||
bool ret = lock.compare_exchange_weak(_false, true, std::memory_order_acquire);
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline void releaseSpinlock(std::atomic<bool> &lock)
|
||||
inline void releaseSpinlock(std::atomic<bool>& lock)
|
||||
{
|
||||
lock.store(false, std::memory_order_release);
|
||||
lock.store(false, std::memory_order_release);
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace utils
|
||||
|
Reference in New Issue
Block a user