ARouter icon indicating copy to clipboard operation
ARouter copied to clipboard

拦截器检查拦截器初始状态的时候判断是否改为if更好

Open treewzx opened this issue 3 years ago • 0 comments

private static void checkInterceptorsInitStatus() { synchronized (interceptorInitLock) { while (!interceptorHasInit) { try { interceptorInitLock.wait(10 * 1000); } catch (InterruptedException e) { throw new HandlerException(TAG + "Interceptor init cost too much time error! reason = [" + e.getMessage() + "]"); } } } } 这个while循环是否改为if判断更好,如果说10S内没有完成初始化,interceptorHasInit没有置为true,还会进行循环,失去了timeout的意义。

treewzx avatar May 13 '21 08:05 treewzx