From 9b74129a4f2d3edd4502dd263b54535aa67780a0 Mon Sep 17 00:00:00 2001 From: Michael Bebenita Date: Tue, 7 Sep 2010 18:05:42 -0700 Subject: Added a thread utility class to factor out operations on threads. --- src/rt/sync/sync.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/rt/sync/sync.h') diff --git a/src/rt/sync/sync.h b/src/rt/sync/sync.h index 8c9a13f0..562d2a1b 100644 --- a/src/rt/sync/sync.h +++ b/src/rt/sync/sync.h @@ -11,4 +11,25 @@ public: } }; +/** + * Thread utility class. Derive and implement your own run() method. + */ +class rust_thread { +public: +#if defined(__WIN32__) + HANDLE thread; +#else + pthread_t thread; +#endif + void start(); + + virtual void run() { + return; + } + + void join(); + + bool is_running(); +}; + #endif /* SYNC_H */ -- cgit v1.2.3