Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1100)

Unified Diff: src/unbound-queue-inl.h

Issue 316133002: Move atomic ops and related files to base library (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/unbound-queue.h ('k') | src/v8.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/unbound-queue-inl.h
diff --git a/src/unbound-queue-inl.h b/src/unbound-queue-inl.h
index d83c01c7310447e4f532f172fcf3119d662a1479..6782281680046fd8e78a68e452ea82fcd1afa6e0 100644
--- a/src/unbound-queue-inl.h
+++ b/src/unbound-queue-inl.h
@@ -7,8 +7,6 @@
#include "src/unbound-queue.h"
-#include "src/atomicops.h"
-
namespace v8 {
namespace internal {
@@ -26,7 +24,7 @@ struct UnboundQueue<Record>::Node: public Malloced {
template<typename Record>
UnboundQueue<Record>::UnboundQueue() {
first_ = new Node(Record());
- divider_ = last_ = reinterpret_cast<AtomicWord>(first_);
+ divider_ = last_ = reinterpret_cast<base::AtomicWord>(first_);
}
@@ -46,10 +44,10 @@ void UnboundQueue<Record>::DeleteFirst() {
template<typename Record>
bool UnboundQueue<Record>::Dequeue(Record* rec) {
- if (divider_ == Acquire_Load(&last_)) return false;
+ if (divider_ == base::Acquire_Load(&last_)) return false;
Node* next = reinterpret_cast<Node*>(divider_)->next;
*rec = next->value;
- Release_Store(&divider_, reinterpret_cast<AtomicWord>(next));
+ base::Release_Store(&divider_, reinterpret_cast<base::AtomicWord>(next));
return true;
}
@@ -58,9 +56,9 @@ template<typename Record>
void UnboundQueue<Record>::Enqueue(const Record& rec) {
Node*& next = reinterpret_cast<Node*>(last_)->next;
next = new Node(rec);
- Release_Store(&last_, reinterpret_cast<AtomicWord>(next));
+ base::Release_Store(&last_, reinterpret_cast<base::AtomicWord>(next));
- while (first_ != reinterpret_cast<Node*>(Acquire_Load(&divider_))) {
+ while (first_ != reinterpret_cast<Node*>(base::Acquire_Load(&divider_))) {
DeleteFirst();
}
}
@@ -68,13 +66,13 @@ void UnboundQueue<Record>::Enqueue(const Record& rec) {
template<typename Record>
bool UnboundQueue<Record>::IsEmpty() const {
- return NoBarrier_Load(&divider_) == NoBarrier_Load(&last_);
+ return base::NoBarrier_Load(&divider_) == base::NoBarrier_Load(&last_);
}
template<typename Record>
Record* UnboundQueue<Record>::Peek() const {
- if (divider_ == Acquire_Load(&last_)) return NULL;
+ if (divider_ == base::Acquire_Load(&last_)) return NULL;
Node* next = reinterpret_cast<Node*>(divider_)->next;
return &next->value;
}
« no previous file with comments | « src/unbound-queue.h ('k') | src/v8.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698