1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef V8_LIBPLATFORM_TASK_QUEUE_H_
6 #define V8_LIBPLATFORM_TASK_QUEUE_H_
10 #include "src/base/macros.h"
11 #include "src/base/platform/mutex.h"
12 #include "src/base/platform/semaphore.h"
25 // Appends a task to the queue. The queue takes ownership of |task|.
26 void Append(Task* task);
28 // Returns the next task to process. Blocks if no task is available. Returns
29 // NULL if the queue is terminated.
32 // Terminate the queue.
37 base::Semaphore process_queue_semaphore_;
38 std::queue<Task*> task_queue_;
41 DISALLOW_COPY_AND_ASSIGN(TaskQueue);
44 } // namespace platform
48 #endif // V8_LIBPLATFORM_TASK_QUEUE_H_