コード例 #1
0
 public <T> T runWriteAction(@NotNull final Computable<T> computation) {
   final AccessToken token = acquireWriteActionLock(computation.getClass());
   try {
     return computation.compute();
   } finally {
     token.finish();
   }
 }
コード例 #2
0
  public <T> T runReadAction(@NotNull final Computable<T> computation) {
    final AccessToken token = acquireReadActionLockImpl(false);

    try {
      return computation.compute();
    } finally {
      token.finish();
    }
  }