diff --git a/bundles/org.openhab.automation.jsscripting/src/main/java/org/openhab/automation/jsscripting/internal/OpenhabGraalJSScriptEngine.java b/bundles/org.openhab.automation.jsscripting/src/main/java/org/openhab/automation/jsscripting/internal/OpenhabGraalJSScriptEngine.java index 5cca25dccde4c..b842b3bb0ce41 100644 --- a/bundles/org.openhab.automation.jsscripting/src/main/java/org/openhab/automation/jsscripting/internal/OpenhabGraalJSScriptEngine.java +++ b/bundles/org.openhab.automation.jsscripting/src/main/java/org/openhab/automation/jsscripting/internal/OpenhabGraalJSScriptEngine.java @@ -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); } @@ -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