Skip to content

Commit

Permalink
fix race condition Job.run() with IJobChangeEvent.running() #271
Browse files Browse the repository at this point in the history
The abbreviation check eventQueueThread.isEmpty() can become true before
all events processed. Need to have a lock before doing the check.
  • Loading branch information
EcljpseB0T authored and jukzi committed Jan 9, 2023
1 parent 7d89800 commit 2f1fbac
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void waitAndSendEvents(InternalJob job, boolean shouldSend) {
boolean send = shouldSend || job.eventQueueLock.isHeldByCurrentThread();
// Synchronize eventQueue to get a stable order of events across Threads.
// There is however no guarantee in which Thread the event is delivered.
while (!job.eventQueue.isEmpty()) {
while (true) {
if (getJobListenerTimeout() == 0) {
// backward compatibility mode for listeners that may deadlock
if (send) {
Expand Down

0 comments on commit 2f1fbac

Please sign in to comment.