39 lines
588 B
C++
39 lines
588 B
C++
#ifndef __FISHBONE_THREAD_H__
|
|
#define __FISHBONE_THREAD_H__
|
|
|
|
namespace fishbone {
|
|
class Thread;
|
|
class Mutex;
|
|
}; // namespace fishbone
|
|
|
|
#include <fishbone/machdep.h>
|
|
|
|
namespace fishbone {
|
|
class Thread {
|
|
struct Impl;
|
|
Impl* impl;
|
|
|
|
public:
|
|
Thread(void (*call)(fishbone::Thread* thread, void* arg), void* arg);
|
|
~Thread();
|
|
|
|
void join();
|
|
};
|
|
|
|
class Mutex {
|
|
struct Impl;
|
|
Impl* impl;
|
|
|
|
public:
|
|
Mutex();
|
|
~Mutex();
|
|
|
|
Mutex(const Mutex&) = delete;
|
|
Mutex& operator=(const Mutex&) = delete;
|
|
|
|
void lock();
|
|
void unlock();
|
|
};
|
|
}; // namespace fishbone
|
|
|
|
#endif
|