Made thread worker processing limits configurable at runtime (bug 5326, r=psychonic).

This commit is contained in:
Asher Baker
2012-12-14 15:16:35 -05:00
parent e77ad244ad
commit 439986e3fe
5 changed files with 28 additions and 9 deletions
+18 -1
View File
@@ -40,7 +40,7 @@
#include <IShareSys.h>
#define SMINTERFACE_THREADER_NAME "IThreader"
#define SMINTERFACE_THREADER_VERSION 2
#define SMINTERFACE_THREADER_VERSION 3
namespace SourceMod
{
@@ -362,6 +362,23 @@ namespace SourceMod
* @return State of the worker.
*/
virtual WorkerState GetStatus(unsigned int *numThreads) =0;
/**
* @brief Sets the number of threads to run per frame.
* Default value is 1 thread per frame.
*
* @param threads Number of threads to run per frame.
*/
virtual void SetMaxThreadsPerFrame(unsigned int threads) =0;
/**
* @brief For threaded workers, the think time of a frame.
* Has no effect for non-threaded workers.
* Default value is 50ms.
*
* @param thinktime Number of ms to sleep between frame execution.
*/
virtual void SetThinkTimePerFrame(unsigned int thinktime) =0;
};
/**