|
AndroMeta
2.0.0
|
00001 /* 00002 * Copyright 2009-2012 AndroMeta LLC. All rights reserved. 00003 * 00004 * AndroMeta LLC retains all intellectual property and proprietary 00005 * rights to this software and related documentation and any modifications 00006 * thereto. Any use, reproduction, disclosure, or distribution of this 00007 * software and related documentation without an express license agreement 00008 * from AndroMeta LLC is strictly prohibited. 00009 * 00010 */ 00011 00019 #ifndef ANDROMETA_M_PROC_TASK_H 00020 #define ANDROMETA_M_PROC_TASK_H 00021 00022 #include <AndroMeta/MProc.h> 00023 00024 namespace Meta{ 00025 00031 class MProcTask{ 00032 public: 00033 00040 MProcTask(size_t threads); 00041 00054 MProcTask(size_t startThreads, 00055 size_t maxThreads, 00056 long queueMax=-1); 00057 00061 ~MProcTask(); 00062 00066 void run(); 00067 00072 void run(const mtime& timeout); 00073 00077 size_t currentThreads() const; 00078 00084 void halt(bool clear=false); 00085 00089 void resume(); 00090 00094 void reset(); 00095 00100 void setMinPriority(double priority); 00101 00105 void clearMinPriority(); 00106 00111 void await(); 00112 00119 bool await(const mtime& timeout); 00120 00121 friend class MProcTask_; 00122 00123 private: 00124 MProcTask& operator=(const MProcTask&); 00125 MProcTask(const MProcTask&); 00126 00127 class MProcTask_* x_; 00128 }; 00129 00130 } // end namespace Meta 00131 00132 #endif // ANDROMETA_M_PROC_TASK_H
1.7.6.1