Revision: 16474
Author: bmeu...@chromium.org
Date: Mon Sep 2 12:36:08 2013 UTC
Log: Fix Mac llvm-gcc42 build after commit r16473.
TBR=machenb...@chromium.org
Review URL: https://codereview.chromium.org/23437020
http://code.google.com/p/v8/source/detail?r=16474
Modified:
/branches/bleeding_edge/test/cctest/test-semaphore.cc
=======================================
--- /branches/bleeding_edge/test/cctest/test-semaphore.cc Mon Sep 2
12:26:06 2013 UTC
+++ /branches/bleeding_edge/test/cctest/test-semaphore.cc Mon Sep 2
12:36:08 2013 UTC
@@ -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() {}
+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();
- }
+ 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 @@
// 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);
--
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.