X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2FMicroSpinLock.h;h=d0c9ac23a19562c69aabd54d4757a56a2684549b;hb=79869083465aabfcb9d9abd7f31ecfe812e3464b;hp=4a691fd1ff54cb5da397f926c01e7efc25d7367a;hpb=708998eb51fe2ce2da91ecd54a106240e51f3d28;p=folly.git diff --git a/folly/MicroSpinLock.h b/folly/MicroSpinLock.h index 4a691fd1..d0c9ac23 100644 --- a/folly/MicroSpinLock.h +++ b/folly/MicroSpinLock.h @@ -1,5 +1,5 @@ /* - * Copyright 2016 Facebook, Inc. + * Copyright 2017 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,17 +38,14 @@ */ #include -#include -#include -#include -#include -#include -#include #include +#include +#include +#include +#include -#include -#include #include +#include namespace folly { @@ -86,11 +83,11 @@ struct MicroSpinLock { sleeper.wait(); } } while (!try_lock()); - DCHECK(payload()->load() == LOCKED); + assert(payload()->load() == LOCKED); } void unlock() { - CHECK(payload()->load() == LOCKED); + assert(payload()->load() == LOCKED); payload()->store(FREE, std::memory_order_release); } @@ -142,10 +139,11 @@ struct FOLLY_ALIGNED_MAX SpinLockArray { "Invalid size of PaddedSpinLock"); // Check if T can theoretically cross a cache line. - static_assert(alignof(std::max_align_t) > 0 && - FOLLY_CACHE_LINE_SIZE % alignof(std::max_align_t) == 0 && - sizeof(T) <= alignof(std::max_align_t), - "T can cross cache line boundaries"); + static_assert( + folly::max_align_v > 0 && + FOLLY_CACHE_LINE_SIZE % folly::max_align_v == 0 && + sizeof(T) <= folly::max_align_v, + "T can cross cache line boundaries"); char padding_[FOLLY_CACHE_LINE_SIZE]; std::array data_;