proxygen
AtomicNotification.h
Go to the documentation of this file.
1 /*
2  * Copyright 2004-present Facebook, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #pragma once
17 
18 #include <atomic>
19 #include <condition_variable>
20 
21 namespace folly {
22 
46 // mimic: std::atomic_wait, p1135r0
47 template <typename Integer>
48 void atomic_wait(const std::atomic<Integer>* atomic, Integer expected);
49 template <typename Integer, typename Clock, typename Duration>
50 std::cv_status atomic_wait_until(
51  const std::atomic<Integer>* atomic,
52  Integer expected,
53  const std::chrono::time_point<Clock, Duration>& deadline);
54 
55 // mimic: std::atomic_notify_one, p1135r0
56 template <typename Integer>
57 void atomic_notify_one(const std::atomic<Integer>* atomic);
58 // mimic: std::atomic_notify_all, p1135r0
59 template <typename Integer>
60 void atomic_notify_all(const std::atomic<Integer>* atomic);
61 
62 // mimic: std::atomic_uint_fast_wait_t, p1135r0
63 using atomic_uint_fast_wait_t = std::atomic<std::uint32_t>;
64 
65 } // namespace folly
66 
—— Concurrent Priority Queue Implementation ——
Definition: AtomicBitSet.h:29
void atomic_notify_all(const std::atomic< Integer > *atomic)
void atomic_wait(const std::atomic< Integer > *atomic, Integer expected)
void atomic_notify_one(const std::atomic< Integer > *atomic)
std::atomic< std::uint32_t > atomic_uint_fast_wait_t
std::cv_status atomic_wait_until(const std::atomic< Integer > *atomic, Integer expected, const std::chrono::time_point< Clock, Duration > &deadline)