Skip to content

Commit 2457b1e

Browse files
committed
minor cleanup
1 parent 357bf48 commit 2457b1e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/hx/concurrent/thread/ThreadPool.hx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,27 @@ import hx.concurrent.thread.Threads;
1414

1515

1616
class ThreadPool extends ServiceBase {
17+
/**
18+
* The default amount of time a worker sleeps waiting for work
19+
*/
20+
public static final DEFAULT_POLL_PERIOD = 0.001;
1721

1822
static final _threadIDs = new AtomicInt();
1923

2024
var _spawnedThreadCount = new AtomicInt(0);
2125
var _workingThreadCount = new AtomicInt(0);
2226
final _workQueue = new Queue<Task>();
23-
var _pollPeriod = DEFAULT_POLL_PERIOD;
2427

2528
public final threadCount:Int;
2629

2730
/**
2831
* The amount of time a worker sleeps waiting for work
2932
*/
30-
public static var DEFAULT_POLL_PERIOD = 0.001;
31-
public var pollPeriod(get, set):Float;
32-
inline function get_pollPeriod():Float return _pollPeriod;
33+
public var pollPeriod(default, set):Float = DEFAULT_POLL_PERIOD;
3334
inline function set_pollPeriod(value:Float) {
3435
if (value <= 0)
3536
throw "[value] must be >= 0";
36-
return _pollPeriod = value;
37+
return pollPeriod = value;
3738
}
3839

3940
/**
@@ -60,7 +61,6 @@ class ThreadPool extends ServiceBase {
6061
start();
6162
}
6263

63-
6464

6565
/**
6666
* Waits for all submitted tasks being executed.

0 commit comments

Comments
 (0)