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

Unified Diff: test/cctest/test-semaphore.cc

Issue 23437020: Fix Mac llvm-gcc42 build after commit r16473. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-semaphore.cc
diff --git a/test/cctest/test-semaphore.cc b/test/cctest/test-semaphore.cc
index a0439116915a0fdde24615b06b3d318ce358bc08..895303f4f877188c8b06a249c94e0480e74bcde0 100644
--- a/test/cctest/test-semaphore.cc
+++ b/test/cctest/test-semaphore.cc
@@ -36,27 +36,28 @@
using namespace ::v8::internal;
-TEST(WaitAndSignal) {
- class WaitAndSignalThread V8_FINAL : public Thread {
- public:
- explicit WaitAndSignalThread(Semaphore* semaphore)
- : Thread("WaitAndSignalThread"), semaphore_(semaphore) {}
- virtual ~WaitAndSignalThread() {}
-
- virtual void Run() V8_OVERRIDE {
- for (int n = 0; n < 1000; ++n) {
- semaphore_->Wait();
- bool result = semaphore_->WaitFor(TimeDelta::FromMicroseconds(1));
- ASSERT(!result);
- USE(result);
- semaphore_->Signal();
- }
+class WaitAndSignalThread V8_FINAL : public Thread {
+ public:
+ explicit WaitAndSignalThread(Semaphore* semaphore)
+ : Thread("WaitAndSignalThread"), semaphore_(semaphore) {}
+ virtual ~WaitAndSignalThread() {}
+
+ virtual void Run() V8_OVERRIDE {
+ for (int n = 0; n < 1000; ++n) {
+ semaphore_->Wait();
+ bool result = semaphore_->WaitFor(TimeDelta::FromMicroseconds(1));
+ ASSERT(!result);
+ USE(result);
+ semaphore_->Signal();
}
+ }
+
+ private:
+ Semaphore* semaphore_;
+};
- private:
- Semaphore* semaphore_;
- };
+TEST(WaitAndSignal) {
Semaphore semaphore(0);
WaitAndSignalThread t1(&semaphore);
WaitAndSignalThread t2(&semaphore);
@@ -93,8 +94,10 @@ TEST(WaitFor) {
// Semaphore signalled - no timeout.
semaphore.Signal();
ok = semaphore.WaitFor(TimeDelta::FromMicroseconds(0));
+ CHECK(ok);
semaphore.Signal();
ok = semaphore.WaitFor(TimeDelta::FromMicroseconds(100));
+ CHECK(ok);
semaphore.Signal();
ok = semaphore.WaitFor(TimeDelta::FromMicroseconds(1000));
CHECK(ok);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698