mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Threading] A couple of header file fixes.
Some declarations were missing from non-Darwin sources, and the Linux header was slightly broken. rdar://90776105
This commit is contained in:
@@ -130,11 +130,11 @@ struct once_t {
|
||||
linux::ulock_t lock;
|
||||
};
|
||||
|
||||
using once_t = std::atomic<int>;
|
||||
void once_slow(once_t &predicate, void (*fn)(void *), void *context);
|
||||
|
||||
inline void once(once_t &predicate, void (*fn)(void *), void *context) {
|
||||
// Sadly we can't use ::pthread_once() for this (no context)
|
||||
if (predicate.load(std::memory_order_acquire) < 0)
|
||||
if (predicate.flag.load(std::memory_order_acquire) < 0)
|
||||
return;
|
||||
|
||||
once_slow(predicate, fn, context);
|
||||
|
||||
Reference in New Issue
Block a user