[jsscripting] Remove Thread.sleep workaround for multi-threading issues with UI-based scripts (#17630)

Follow-up for #1710.
Depends on https://github.com/openhab/openhab-core/pull/4426.

Signed-off-by: Florian Hotze <dev@florianhotze.com>
pull/17639/head
Florian Hotze 2024-10-26 23:27:41 +02:00 committed by GitHub
parent f52cede9ca
commit abe819978f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 0 additions and 14 deletions

View File

@ -304,13 +304,6 @@ public class OpenhabGraalJSScriptEngine
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);
}
@ -385,13 +378,6 @@ public class OpenhabGraalJSScriptEngine
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