org.openide.util.Mutex.toString()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(3.5k)|赞(0)|评价(0)|浏览(127)

本文整理了Java中org.openide.util.Mutex.toString()方法的一些代码示例,展示了Mutex.toString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Mutex.toString()方法的具体详情如下:
包路径:org.openide.util.Mutex
类名称:Mutex
方法名:toString

Mutex.toString介绍

[英]toString
[中]托斯特林

代码示例

代码示例来源:origin: org.netbeans.api/org-openide-util

private boolean reenterImpl(Thread t, int mode) {
  // from leaveX -> grantedMode is NONE or S
  if (mode == S) {
    if ((grantedMode != NONE) && (grantedMode != S)) {
      throw new IllegalStateException(this.toString());
    }
    enter(mode, t, true);
    return false;
  }
  // assert (mode == X)
  ThreadInfo tinfo = getThreadInfo(t);
  boolean chainFromLeaveX = ((grantedMode == CHAIN) && (tinfo != null) && (tinfo.counts[X] > 0));
  // process grantedMode == X or CHAIN from leaveX OR grantedMode == NONE from leaveS
  if ((grantedMode == X) || (grantedMode == NONE) || chainFromLeaveX) {
    enter(mode, t, true);
    return false;
  } else { // remains grantedMode == CHAIN or S from leaveS, so it will be CHAIN
    if (readersNo == 0) {
      throw new IllegalStateException(this.toString());
    }
    ThreadInfo info = new ThreadInfo(t, mode);
    registeredThreads.put(t, info);
    // prevent from grantedMode == NONE (another thread - leaveS)
    readersNo += 2;
    // prevent from new readers
    setGrantedMode(CHAIN);
    return true;
  }
   // else X means ERROR!!!
}

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

throw new IllegalStateException(this.toString());
} else { // remains grantedMode == CHAIN or S from leaveS, so it will be CHAIN
  if (readersNo == 0) {
    throw new IllegalStateException(this.toString());

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

throw new IllegalStateException(this.toString());
} else { // remains grantedMode == CHAIN or S from leaveS, so it will be CHAIN
  if (readersNo == 0) {
    throw new IllegalStateException(this.toString());

代码示例来源:origin: in.jlibs/org-openide-util

private boolean reenterImpl(Thread t, int mode) {
  // from leaveX -> grantedMode is NONE or S
  if (mode == S) {
    if ((grantedMode != NONE) && (grantedMode != S)) {
      throw new IllegalStateException(this.toString());
    }
    enter(mode, t, true);
    return false;
  }
  // assert (mode == X)
  ThreadInfo tinfo = getThreadInfo(t);
  boolean chainFromLeaveX = ((grantedMode == CHAIN) && (tinfo != null) && (tinfo.counts[X] > 0));
  // process grantedMode == X or CHAIN from leaveX OR grantedMode == NONE from leaveS
  if ((grantedMode == X) || (grantedMode == NONE) || chainFromLeaveX) {
    enter(mode, t, true);
    return false;
  } else { // remains grantedMode == CHAIN or S from leaveS, so it will be CHAIN
    if (readersNo == 0) {
      throw new IllegalStateException(this.toString());
    }
    ThreadInfo info = new ThreadInfo(t, mode);
    registeredThreads.put(t, info);
    // prevent from grantedMode == NONE (another thread - leaveS)
    readersNo += 2;
    // prevent from new readers
    setGrantedMode(CHAIN);
    return true;
  }
   // else X means ERROR!!!
}

代码示例来源:origin: uk.gov.nationalarchives.thirdparty.netbeans/org-openide-util

private boolean reenterImpl(Thread t, int mode) {
  // from leaveX -> grantedMode is NONE or S
  if (mode == S) {
    if ((grantedMode != NONE) && (grantedMode != S)) {
      throw new IllegalStateException(this.toString());
    }
    enter(mode, t, true);
    return false;
  }
  // assert (mode == X)
  ThreadInfo tinfo = getThreadInfo(t);
  boolean chainFromLeaveX = ((grantedMode == CHAIN) && (tinfo != null) && (tinfo.counts[X] > 0));
  // process grantedMode == X or CHAIN from leaveX OR grantedMode == NONE from leaveS
  if ((grantedMode == X) || (grantedMode == NONE) || chainFromLeaveX) {
    enter(mode, t, true);
    return false;
  } else { // remains grantedMode == CHAIN or S from leaveS, so it will be CHAIN
    if (readersNo == 0) {
      throw new IllegalStateException(this.toString());
    }
    ThreadInfo info = new ThreadInfo(t, mode);
    registeredThreads.put(t, info);
    // prevent from grantedMode == NONE (another thread - leaveS)
    readersNo += 2;
    // prevent from new readers
    setGrantedMode(CHAIN);
    return true;
  }
   // else X means ERROR!!!
}

相关文章