Skip to content

Commit

Permalink
Fixed unnecessary formatting.
Browse files Browse the repository at this point in the history
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
  • Loading branch information
spericas committed Mar 12, 2021
1 parent bc450f5 commit e48b6e4
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -510,9 +510,11 @@ public boolean offer(Runnable task) {
}
try {
enqueue(task);
} finally {
semaphoreRead.release();
} catch (Exception e) {
semaphoreWrite.release();
return false;
}
semaphoreRead.release();
return true;
}

Expand All @@ -532,9 +534,11 @@ public boolean offer(Runnable task, long timeout, TimeUnit tu) throws Interrupte
}
try {
enqueue(task);
} finally {
semaphoreRead.release();
} catch (Exception e) {
semaphoreWrite.release();
return false;
}
semaphoreRead.release();
return true;
}

Expand All @@ -552,9 +556,11 @@ public void put(Runnable task) throws InterruptedException {
semaphoreWrite.acquire();
try {
enqueue(task);
} finally {
semaphoreRead.release();
} catch (Exception e) {
semaphoreWrite.release();
throw e;
}
semaphoreRead.release();
}

@Override
Expand Down

0 comments on commit e48b6e4

Please sign in to comment.