Skip to content

Commit

Permalink
Merge branch 'dev/1.21.3' into dev/1.21.4
Browse files Browse the repository at this point in the history
  • Loading branch information
ishland committed Nov 29, 2024
2 parents 47581f7 + d32f47f commit c38da30
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ public void run() {
return;
}

// attempt to spin-wait before sleeping
if (!pollTasks()) {
Thread.interrupted(); // clear interrupt flag
for (int i = 0; i < 5000; i ++) {
if (pollTasks()) continue main_loop;
LockSupport.parkNanos("Spin-waiting for tasks", 10_000); // 100us
}
}
// // attempt to spin-wait before sleeping
// if (!pollTasks()) {
// Thread.interrupted(); // clear interrupt flag
// for (int i = 0; i < 5000; i ++) {
// if (pollTasks()) continue main_loop;
// LockSupport.parkNanos("Spin-waiting for tasks", 10_000); // 100us
// }
// }

synchronized (sync) {
if (this.size.get() != 0 || this.shutdown.get()) continue main_loop;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ public void run() {
this.closeFuture.complete(null);
break;
} else {
// attempt to spin-wait before sleeping
if (!pollTasks()) {
Thread.interrupted(); // clear interrupt flag
for (int i = 0; i < 5000; i ++) {
if (pollTasks() || this.closing.get()) continue main_loop;
LockSupport.parkNanos("Spin-waiting for tasks", 10_000); // 100us
}
}
// // attempt to spin-wait before sleeping
// if (!pollTasks()) {
// Thread.interrupted(); // clear interrupt flag
// for (int i = 0; i < 5000; i ++) {
// if (pollTasks() || this.closing.get()) continue main_loop;
// LockSupport.parkNanos("Spin-waiting for tasks", 10_000); // 100us
// }
// }
synchronized (sync) {
if (this.taskSize.get() != 0 || this.closing.get()) continue main_loop;
try {
Expand Down

0 comments on commit c38da30

Please sign in to comment.