cziegeler commented on code in PR #6:
URL:
https://github.com/apache/sling-org-apache-sling-commons-scheduler/pull/6#discussion_r1868637550
##########
src/main/java/org/apache/sling/commons/scheduler/impl/QuartzThreadPool.java:
##########
@@ -77,14 +97,28 @@ public boolean runInThread(final Runnable job) {
*/
@Override
public int blockForAvailableThreads() {
- return this.executor.getConfiguration().getMaxPoolSize() -
this.executor.getConfiguration().getQueueSize();
+ synchronized ( this.lock ) {
+ while ( this.counter == 0 ) {
+ try {
+ this.lock.wait();
+ } catch (final InterruptedException e) {
+ Thread.currentThread().interrupt();
+ }
Review Comment:
Same as above for the <= check :) For the timeout, this might unnecessarily
burn some cpu - which is in most case not necessary
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]