|
@@ -264,6 +264,19 @@ Type TThreadPoolExecutor Extends TExecutor
|
|
|
|
|
|
End Method
|
|
End Method
|
|
|
|
|
|
|
|
+ Rem
|
|
|
|
+ bbdoc: Returns the approximate number of threads that are actively executing tasks.
|
|
|
|
+ end rem
|
|
|
|
+ Method getActiveCount:Int()
|
|
|
|
+ countLock.Lock()
|
|
|
|
+ Local count:Int = threadsWorking
|
|
|
|
+ countLock.unlock()
|
|
|
|
+ return count
|
|
|
|
+ End Method
|
|
|
|
+
|
|
|
|
+ Method IsQueueEmpty:Int()
|
|
|
|
+ return jobQueue.IsEmpty()
|
|
|
|
+ end method
|
|
End Type
|
|
End Type
|
|
|
|
|
|
Private
|
|
Private
|
|
@@ -360,6 +373,13 @@ Type TJobQueue
|
|
Return job
|
|
Return job
|
|
End Method
|
|
End Method
|
|
|
|
|
|
|
|
+ Method IsEmpty:Int()
|
|
|
|
+ Lock()
|
|
|
|
+ Local empty:Int = jobs.IsEmpty()
|
|
|
|
+ UnLock()
|
|
|
|
+ return empty
|
|
|
|
+ End Method
|
|
|
|
+
|
|
Method Lock()
|
|
Method Lock()
|
|
mutex.Lock()
|
|
mutex.Lock()
|
|
End Method
|
|
End Method
|