aboutsummaryrefslogtreecommitdiff
path: root/Gem/develop/include/Gem/Utils/Thread.h
diff options
context:
space:
mode:
authorTravis CI <zmoelnig@travis-ci.umlaeute.mur.at>2017-12-06 23:47:39 +0000
committerTravis CI <zmoelnig@travis-ci.umlaeute.mur.at>2017-12-06 23:47:39 +0000
commitc886922cc0b8c32ead0459b581f51ff60fdebbd4 (patch)
tree98c9b3036116ebfefde32c8c278639b767e2d305 /Gem/develop/include/Gem/Utils/Thread.h
parentff954ec3b2de3f0bce8aee70680469468896df7d (diff)
Gem 427a3d0e61d61e64e76facfa905c120356383bab osx/x86_64
built 'master:427a3d0e61d61e64e76facfa905c120356383bab' for osx/x86_64
Diffstat (limited to 'Gem/develop/include/Gem/Utils/Thread.h')
-rw-r--r--Gem/develop/include/Gem/Utils/Thread.h89
1 files changed, 47 insertions, 42 deletions
diff --git a/Gem/develop/include/Gem/Utils/Thread.h b/Gem/develop/include/Gem/Utils/Thread.h
index ca861cc..3daa020 100644
--- a/Gem/develop/include/Gem/Utils/Thread.h
+++ b/Gem/develop/include/Gem/Utils/Thread.h
@@ -17,48 +17,53 @@ LOG
#include "Gem/ExportDef.h"
-namespace gem { namespace thread {
- /**
- * get the number of available CPUs on the system
- */
- GEM_EXTERN unsigned int getCPUCount(void);
-
- class GEM_EXTERN Thread {
- private:
- class PIMPL;
- PIMPL*m_pimpl;
- friend class PIMPL;
-
- Thread(const Thread&);
- Thread&operator=(const Thread&);
- public:
- Thread(void);
- virtual ~Thread(void);
-
- ////
- // start thread
- virtual bool start(void);
- ////
- // stop thread
- // waits for at most wait4usec microseconds
- // is wait4usec==0, waits until process terminates (e.g. forever)
- virtual bool stop(unsigned int wait4usec=0);
-
- protected:
- ////
- // the worker!
- // get's called from an alternative thread
- // if TRUE is returned, process() will be called again
- // until stop() is called
- // if FALSE is returned, the thread may exit
- virtual bool process(void) = 0;
- };
-
-
- ////////
- // wrapper around select() or whatever
- GEM_EXTERN void usleep(unsigned long usec);
-};}; // namespace
+namespace gem
+{
+namespace thread
+{
+/**
+ * get the number of available CPUs on the system
+ */
+GEM_EXTERN unsigned int getCPUCount(void);
+
+class GEM_EXTERN Thread
+{
+private:
+ class PIMPL;
+ PIMPL*m_pimpl;
+ friend class PIMPL;
+
+ Thread(const Thread&);
+ Thread&operator=(const Thread&);
+public:
+ Thread(void);
+ virtual ~Thread(void);
+
+ ////
+ // start thread
+ virtual bool start(void);
+ ////
+ // stop thread
+ // waits for at most wait4usec microseconds
+ // is wait4usec==0, waits until process terminates (e.g. forever)
+ virtual bool stop(unsigned int wait4usec=0);
+
+protected:
+ ////
+ // the worker!
+ // get's called from an alternative thread
+ // if TRUE is returned, process() will be called again
+ // until stop() is called
+ // if FALSE is returned, the thread may exit
+ virtual bool process(void) = 0;
+};
+
+
+////////
+// wrapper around select() or whatever
+GEM_EXTERN void usleep(unsigned long usec);
+};
+}; // namespace