Cannot do this; another thread might be just entering the `finally` block to unlock the lock, having just set it to not null.

Why not (inside the lock) re-check the `if (this.scriptClass == null || scriptSource.isModified())` ??