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

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

Issue 1138004: Add multithreading test for SamplingCircularQueue, fix implementation. (Closed)
Patch Set: Created 10 years, 9 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/circular-queue.cc ('k') | src/cpu-profiler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/circular-queue-inl.h
diff --git a/src/circular-queue-inl.h b/src/circular-queue-inl.h
index ffe8fb003eaa1addf4292d427a3a25f6a5642b56..962b069fb0fb481b7d1394ffc9e473299641e136 100644
--- a/src/circular-queue-inl.h
+++ b/src/circular-queue-inl.h
@@ -82,11 +82,10 @@ Record* CircularQueue<Record>::Next(Record* curr) {
void* SamplingCircularQueue::Enqueue() {
- Cell* enqueue_pos = reinterpret_cast<Cell*>(
- Thread::GetThreadLocal(producer_key_));
- WrapPositionIfNeeded(&enqueue_pos);
- Thread::SetThreadLocal(producer_key_, enqueue_pos + record_size_);
- return enqueue_pos;
+ WrapPositionIfNeeded(&producer_pos_->enqueue_pos);
+ void* result = producer_pos_->enqueue_pos;
+ producer_pos_->enqueue_pos += record_size_;
+ return result;
}
« no previous file with comments | « src/circular-queue.cc ('k') | src/cpu-profiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698