/*
- * Copyright 2015 Facebook, Inc.
+ * Copyright 2016 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <condition_variable>
#include <mutex>
#include <boost/intrusive/list.hpp>
+#include <folly/CallOnce.h>
#include <folly/Hash.h>
#include <folly/ScopeGuard.h>
static const size_t kNumBuckets = 4096;
static EmulatedFutexBucket* gBuckets;
- static std::once_flag gBucketInit;
+ static folly::once_flag gBucketInit;
static EmulatedFutexBucket& bucketFor(void* addr) {
- std::call_once(gBucketInit, [](){
+ folly::call_once(gBucketInit, [](){
gBuckets = new EmulatedFutexBucket[kNumBuckets];
});
uint64_t mixedBits = folly::hash::twang_mix64(
};
EmulatedFutexBucket* EmulatedFutexBucket::gBuckets;
-std::once_flag EmulatedFutexBucket::gBucketInit;
+folly::once_flag EmulatedFutexBucket::gBucketInit;
int emulatedFutexWake(void* addr, int count, uint32_t waitMask) {
auto& bucket = EmulatedFutexBucket::bucketFor(addr);