| Index: runtime/vm/thread.h
|
| diff --git a/runtime/vm/thread.h b/runtime/vm/thread.h
|
| index 2c5fad007022f0c4d2e3b7d78b6591b9a557696f..c554fb6af7f2370bc4dcf77a39cc78582c54acb8 100644
|
| --- a/runtime/vm/thread.h
|
| +++ b/runtime/vm/thread.h
|
| @@ -6,84 +6,13 @@
|
| #define VM_THREAD_H_
|
|
|
| #include "platform/assert.h"
|
| +#include "platform/thread.h"
|
| #include "vm/allocation.h"
|
| #include "vm/globals.h"
|
| #include "vm/isolate.h"
|
|
|
| -// Declare the OS-specific types ahead of defining the generic classes.
|
| -#if defined(TARGET_OS_LINUX)
|
| -#include "vm/thread_linux.h"
|
| -#elif defined(TARGET_OS_MACOS)
|
| -#include "vm/thread_macos.h"
|
| -#elif defined(TARGET_OS_WINDOWS)
|
| -#include "vm/thread_win.h"
|
| -#else
|
| -#error Unknown target os.
|
| -#endif
|
| -
|
| namespace dart {
|
|
|
| -class Thread {
|
| - public:
|
| - // Function to be called on thread start.
|
| - typedef void (*ThreadStartFunction) (uword parameter);
|
| -
|
| - // TODO(iposva): Define the proper interface for spawning and killing threads.
|
| - Thread(ThreadStartFunction function, uword parameters);
|
| - ~Thread();
|
| -
|
| - private:
|
| - ThreadData data_;
|
| -
|
| - DISALLOW_COPY_AND_ASSIGN(Thread);
|
| -};
|
| -
|
| -
|
| -class Mutex {
|
| - public:
|
| - Mutex();
|
| - ~Mutex();
|
| -
|
| - void Lock();
|
| - bool TryLock();
|
| - void Unlock();
|
| -
|
| - private:
|
| - MutexData data_;
|
| -
|
| - DISALLOW_COPY_AND_ASSIGN(Mutex);
|
| -};
|
| -
|
| -
|
| -class Monitor {
|
| - public:
|
| - enum WaitResult {
|
| - kNotified,
|
| - kTimedOut
|
| - };
|
| -
|
| - static const int64_t kNoTimeout = 0;
|
| -
|
| - Monitor();
|
| - ~Monitor();
|
| -
|
| - void Enter();
|
| - void Exit();
|
| -
|
| - // Wait for notification or timeout.
|
| - WaitResult Wait(int64_t millis);
|
| -
|
| - // Notify waiting threads.
|
| - void Notify();
|
| - void NotifyAll();
|
| -
|
| - private:
|
| - MonitorData data_; // OS-specific data.
|
| -
|
| - DISALLOW_COPY_AND_ASSIGN(Monitor);
|
| -};
|
| -
|
| -
|
| class MutexLocker : public StackResource {
|
| public:
|
| explicit MutexLocker(Mutex* mutex) :
|
|
|