projects
/
folly.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Clarify in the docs what belongs in portability/
[folly.git]
/
folly
/
ProducerConsumerQueue.h
diff --git
a/folly/ProducerConsumerQueue.h
b/folly/ProducerConsumerQueue.h
index 98a5088b7d314b5d0bb17ff02389deb7e6ffaeb0..9ebe65acb46c66dbef1f9ab33e77e07fd968bdeb 100644
(file)
--- a/
folly/ProducerConsumerQueue.h
+++ b/
folly/ProducerConsumerQueue.h
@@
-1,5
+1,5
@@
/*
/*
- * Copyright 201
6
Facebook, Inc.
+ * Copyright 201
7
Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-27,6
+27,8
@@
#include <type_traits>
#include <utility>
#include <type_traits>
#include <utility>
+#include <folly/detail/CacheLocality.h>
+
namespace folly {
/*
namespace folly {
/*
@@
-166,11
+168,14
@@
struct ProducerConsumerQueue {
}
private:
}
private:
+ char pad0_[detail::CacheLocality::kFalseSharingRange];
const uint32_t size_;
T* const records_;
const uint32_t size_;
T* const records_;
- std::atomic<unsigned int> readIndex_;
- std::atomic<unsigned int> writeIndex_;
+ FOLLY_ALIGN_TO_AVOID_FALSE_SHARING std::atomic<unsigned int> readIndex_;
+ FOLLY_ALIGN_TO_AVOID_FALSE_SHARING std::atomic<unsigned int> writeIndex_;
+
+ char pad1_[detail::CacheLocality::kFalseSharingRange - sizeof(writeIndex_)];
};
}
};
}