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

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

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

Mutex.leave介绍

[英]Leaves this mutex
[中]离开这个互斥

代码示例

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

public void exitWriteAccess() {
    parent.leave(Thread.currentThread());
  }
}

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

leave(t); // release lock grabbed - shared

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

public void exitReadAccess() {
  parent.leave(Thread.currentThread());
}

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

/** Run an action with read access, returning no result.
* It may be run asynchronously.
*
* @param action the action to perform
* @see #readAccess(Mutex.Action)
*/
public void readAccess(final Runnable action) {
  if (this == EVENT) {
    doEvent(action);
    return;
  }
  if (wrapper != null) {
    try {
      doWrapperAccess(null, action, true);
      return;
    } catch (MutexException ex) {
      throw new IllegalStateException(ex);
    }
  }
  Thread t = Thread.currentThread();
  readEnter(t);
  try {
    action.run();
  } finally {
    leave(t);
  }
}

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

/** Run an action with write access and return no result.
* It may be run asynchronously.
*
* @param action the action to perform
* @see #writeAccess(Mutex.Action)
* @see #readAccess(Runnable)
*/
public void writeAccess(final Runnable action) {
  if (this == EVENT) {
    doEvent(action);
    return;
  }
  if (wrapper != null) {
    try {
      doWrapperAccess(null, action, false);
    } catch (MutexException ex) {
      throw new IllegalStateException(ex);
    }
    return;
  }
  Thread t = Thread.currentThread();
  writeEnter(t);
  try {
    action.run();
  } finally {
    leave(t);
  }
}

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

run.run();
  } finally {
    leave(t);
  run.run();
} finally {
  leave(t);

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

/** Run an action only with read access.
* See class description re. entering for write access within the dynamic scope.
* @param action the action to perform
* @return the object returned from {@link Mutex.Action#run}
*/
public <T> T readAccess(final Action<T> action) {
  if (this == EVENT) {
    try {
      return doEventAccess(action);
    } catch (MutexException e) {
      throw (InternalError) new InternalError("Exception from non-Exception Action").initCause(e.getException()); // NOI18N
    }
  }
  if (wrapper != null) {
    try {
      return doWrapperAccess(action, null, true);
    } catch (MutexException e) {
      throw (InternalError) new InternalError("Exception from non-Exception Action").initCause(e.getException()); // NOI18N
    }
  }
  Thread t = Thread.currentThread();
  readEnter(t);
  try {
    return action.run();
  } finally {
    leave(t);
  }
}

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

/** Run an action with write access.
* The same thread may meanwhile reenter the mutex; see the class description for details.
*
* @param action the action to perform
* @return the result of {@link Mutex.Action#run}
*/
public <T> T writeAccess(Action<T> action) {
  if (this == EVENT) {
    try {
      return doEventAccess(action);
    } catch (MutexException e) {
      throw (InternalError) new InternalError("Exception from non-Exception Action").initCause(e.getException()); // NOI18N
    }
  }
  if (wrapper != null) {
    try {
      return doWrapperAccess(action, null, false);
    } catch (MutexException e) {
      throw (InternalError) new InternalError("Exception from non-Exception Action").initCause(e.getException()); // NOI18N
    }
  }
  Thread t = Thread.currentThread();
  writeEnter(t);
  try {
    return action.run();
  } finally {
    leave(t);
  }
}

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

throw new MutexException(e);
} finally {
  leave(t);

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

throw new MutexException(e);
} finally {
  leave(t);

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

public void exitWriteAccess() {
    parent.leave(Thread.currentThread());
  }
}

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

public void exitWriteAccess() {
    parent.leave(Thread.currentThread());
  }
}

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

public void exitReadAccess() {
  parent.leave(Thread.currentThread());
}

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

public void exitReadAccess() {
  parent.leave(Thread.currentThread());
}

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

/** Run an action with read access, returning no result.
* It may be run asynchronously.
*
* @param action the action to perform
* @see #readAccess(Mutex.Action)
*/
public void readAccess (final Runnable action) {
  if (this == EVENT) {
    doEvent (action);
    return;
  }
  Thread t = Thread.currentThread();
  readEnter(t);
  try {
    action.run();
  } finally {
    leave(t);
  }
}

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

/** Run an action with read access, returning no result.
* It may be run asynchronously.
*
* @param action the action to perform
* @see #readAccess(Mutex.Action)
*/
public void readAccess (final Runnable action) {
  if (this == EVENT) {
    doEvent (action);
    return;
  }
  Thread t = Thread.currentThread();
  readEnter(t);
  try {
    action.run();
  } finally {
    leave(t);
  }
}

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

/** Run an action with write access and return no result.
* It may be run asynchronously.
*
* @param action the action to perform
* @see #writeAccess(Mutex.Action)
* @see #readAccess(Runnable)
*/
public void writeAccess (final Runnable action) {
  if (this == EVENT) {
    doEvent (action);
    return;
  }
  Thread t = Thread.currentThread();
  writeEnter(t);
  try {
    action.run();
  } finally {
    leave(t);
  }
}

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

/** Run an action with write access and return no result.
* It may be run asynchronously.
*
* @param action the action to perform
* @see #writeAccess(Mutex.Action)
* @see #readAccess(Runnable)
*/
public void writeAccess (final Runnable action) {
  if (this == EVENT) {
    doEvent (action);
    return;
  }
  Thread t = Thread.currentThread();
  writeEnter(t);
  try {
    action.run();
  } finally {
    leave(t);
  }
}

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

/** Run an action only with read access.
* See class description re. entering for write access within the dynamic scope.
* @param action the action to perform
* @return the object returned from {@link Mutex.Action#run}
*/
public Object readAccess (Action action) {
  if (this == EVENT) {
    try {
      return doEventAccess (action);
    } catch (MutexException e) {
  InternalError err = new InternalError("Exception from non-Exception Action"); // NOI18N
  ErrorManager.getDefault().annotate(err, e.getException());
  throw err;
    }
  }
  Thread t = Thread.currentThread();
  readEnter(t);
  try {
    return action.run();
  } finally {
    leave(t);
  }
}

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

/** Run an action only with read access.
* See class description re. entering for write access within the dynamic scope.
* @param action the action to perform
* @return the object returned from {@link Mutex.Action#run}
*/
public Object readAccess (Action action) {
  if (this == EVENT) {
    try {
      return doEventAccess (action);
    } catch (MutexException e) {
  InternalError err = new InternalError("Exception from non-Exception Action"); // NOI18N
  ErrorManager.getDefault().annotate(err, e.getException());
  throw err;
    }
  }
  Thread t = Thread.currentThread();
  readEnter(t);
  try {
    return action.run();
  } finally {
    leave(t);
  }
}

相关文章