mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Threading] Put everything through git clang-format.
Just formatting changes. rdar://90776105
This commit is contained in:
@@ -16,8 +16,8 @@
|
||||
|
||||
#if SWIFT_THREADING_LINUX
|
||||
|
||||
#include "swift/Threading/Errors.h"
|
||||
#include "swift/Threading/Impl/Linux.h"
|
||||
#include "swift/Threading/Errors.h"
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -27,6 +27,7 @@ namespace {
|
||||
class MainThreadRememberer {
|
||||
private:
|
||||
pthread_t mainThread_;
|
||||
|
||||
public:
|
||||
MainThreadRememberer() { mainThread_ = pthread_self(); }
|
||||
|
||||
@@ -37,20 +38,17 @@ MainThreadRememberer rememberer;
|
||||
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
}
|
||||
} // namespace
|
||||
|
||||
using namespace swift;
|
||||
using namespace threading_impl;
|
||||
|
||||
bool
|
||||
swift::threading_impl::thread_is_main() {
|
||||
bool swift::threading_impl::thread_is_main() {
|
||||
return pthread_equal(pthread_self(), rememberer.main_thread());
|
||||
}
|
||||
|
||||
void
|
||||
swift::threading_impl::once_slow(once_t &predicate,
|
||||
void (*fn)(void *),
|
||||
void *context) {
|
||||
void swift::threading_impl::once_slow(once_t &predicate, void (*fn)(void *),
|
||||
void *context) {
|
||||
linux::ulock_lock(&predicate.lock);
|
||||
if (predicate.flag.load(std::memory_order_acquire) == 0) {
|
||||
fn(context);
|
||||
|
||||
Reference in New Issue
Block a user