Skip to content

Commit

Permalink
[jsscripting] Remove Thread.sleep workaround for multi-threading issu…
Browse files Browse the repository at this point in the history
…es with UI-based scripts (#17630)

Follow-up for #1710.
Depends on openhab/openhab-core#4426.

Signed-off-by: Florian Hotze <[email protected]>
  • Loading branch information
florian-h05 authored Oct 26, 2024
1 parent f52cede commit abe8199
Showing 1 changed file with 0 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -304,13 +304,6 @@ protected void beforeInvocation() {
protected Object afterInvocation(Object obj) {
lock.unlock();
logger.debug("Lock released after invocation.");
// Fixes illegal multi-thread access requested in UI-based scripts, where the script is running and a timer is
// waiting to acquire the lock.
try {
Thread.sleep(10);
} catch (InterruptedException e) {
throw new RuntimeException("Thread interrupted while sleeping", e);
}
return super.afterInvocation(obj);
}

Expand Down Expand Up @@ -385,13 +378,6 @@ public boolean tryLock(long l, TimeUnit timeUnit) throws InterruptedException {
public void unlock() {
lock.unlock();
logger.debug("Lock released.");
// Fixes illegal multi-thread access requested in UI-based scripts, where the script is running and a timer is
// waiting to acquire the lock.
try {
Thread.sleep(10);
} catch (InterruptedException e) {
throw new RuntimeException("Thread interrupted while sleeping", e);
}
}

@Override
Expand Down

0 comments on commit abe8199

Please sign in to comment.