#include "test/cctest/cctest.h"
using namespace v8::internal;
+using namespace v8::platform;
class TaskCounter {
public:
~TaskCounter() { CHECK_EQ(0, counter_); }
int GetCount() const {
- LockGuard<Mutex> guard(&lock_);
+ v8::base::LockGuard<v8::base::Mutex> guard(&lock_);
return counter_;
}
void Inc() {
- LockGuard<Mutex> guard(&lock_);
+ v8::base::LockGuard<v8::base::Mutex> guard(&lock_);
++counter_;
}
void Dec() {
- LockGuard<Mutex> guard(&lock_);
+ v8::base::LockGuard<v8::base::Mutex> guard(&lock_);
--counter_;
}
private:
- mutable Mutex lock_;
+ mutable v8::base::Mutex lock_;
int counter_;
DISALLOW_COPY_AND_ASSIGN(TaskCounter);
};
-class TestWorkerThread : public Thread {
+class TestWorkerThread : public v8::base::Thread {
public:
explicit TestWorkerThread(v8::Task* task)
- : Thread("libplatform TestWorkerThread"), semaphore_(0), task_(task) {}
+ : Thread(Options("libplatform TestWorkerThread")),
+ semaphore_(0),
+ task_(task) {}
virtual ~TestWorkerThread() {}
void Signal() { semaphore_.Signal(); }
}
private:
- Semaphore semaphore_;
+ v8::base::Semaphore semaphore_;
v8::Task* task_;
DISALLOW_COPY_AND_ASSIGN(TestWorkerThread);