mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-06-26 06:14:42 +02:00
Add method to pass thread-indicator via an extra argument.
This commit is contained in:
parent
65fc88f41a
commit
7d7a0bf010
|
@ -115,6 +115,23 @@ public class Counters {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience: pass state via a boolean.
|
||||
*
|
||||
* @param id
|
||||
* @param count
|
||||
* @param isPrimaryThread
|
||||
* Must be correct.
|
||||
*/
|
||||
public void add(int id, int count, boolean isPrimaryThread) {
|
||||
if (isPrimaryThread) {
|
||||
ptCounts[id].count ++;
|
||||
}
|
||||
else {
|
||||
addSynchronized(id, count);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Only call from the primary thread.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue
Block a user