public boolean isLocked() {
        return this.lock.isLocked();
    }
Set error code, run the onError callback
with code immediately in lock.
@param errorCode error code
jraft-core/src/main/java/com/alipay/sofa/jraft/util/ThreadId.java