00001 /* vim: set sw=2: 00002 * Copyright (c) 2009, Gennady Bystritsky <bystr@mac.com> 00003 * 00004 * Distributed under the MIT Licence. 00005 * This is free software. See 'LICENSE' for details. 00006 * You must read and accept the license prior to use. 00007 * 00008 * Author: Gennady Bystritsky 00009 */ 00010 00011 #ifndef _SK_RT_THREAD_ABSTRACT_IMPLEMENTATION_H_ 00012 #define _SK_RT_THREAD_ABSTRACT_IMPLEMENTATION_H_ 00013 00014 #include <sk/util/Object.h> 00015 #include <sk/rt/thread/abstract/Mutex.h> 00016 #include <sk/rt/thread/abstract/Thread.h> 00017 #include <sk/rt/Runnable.h> 00018 #include <sk/rt/thread/Generic.h> 00019 00020 namespace sk { 00021 namespace rt { 00022 namespace thread { 00023 namespace abstract { 00024 class Implementation 00025 : public virtual sk::util::Object 00026 { 00027 public: 00028 virtual abstract::Mutex* makeSimpleMutex() const = 0; 00029 virtual abstract::Mutex* makeRecursiveMutex() const = 0; 00030 virtual abstract::Thread* makeThread(sk::rt::Runnable& target, sk::rt::thread::Generic& handle) const = 0; 00031 virtual abstract::Thread* wrapCurrentThread(sk::rt::thread::Generic& handle) const = 0; 00032 virtual sk::rt::thread::Generic& getGeneric() const = 0; 00033 virtual void sleep(uint64_t milliseconds) const = 0; 00034 virtual void yield() const = 0; 00035 }; 00036 } 00037 } 00038 } 00039 } 00040 00041 #endif /* _SK_RT_THREAD_ABSTRACT_IMPLEMENTATION_H_ */