Skip to content

Commit 024630b

Browse files
committed
Made thread priority reduction dependent on async mode
1 parent b735923 commit 024630b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/bwapi/BWClient.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,10 @@ public void startGame(BWClientConfiguration configuration) {
8181

8282
// Use reduced priority to encourage Windows to give priority to StarCraft.exe/BWAPI.
8383
// If BWAPI doesn't get priority, it may not detect completion of a frame on our end in timely fashion.
84-
Thread.currentThread().setPriority(4);
84+
Thread.currentThread().setName("JBWAPI Client");
85+
if (configuration.async) {
86+
Thread.currentThread().setPriority(4);
87+
}
8588

8689
if (client == null) {
8790
client = new Client(configuration);

0 commit comments

Comments
 (0)