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

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

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

Mutex.writeEnter介绍

[英]enters this mutex for writing
[中]输入此互斥以进行写入

代码示例

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

public void enterWriteAccess() {
  parent.writeEnter(Thread.currentThread());
}

代码示例来源: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 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

writeEnter(t);

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

public void enterWriteAccess() {
  parent.writeEnter(Thread.currentThread());
}

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

public void enterWriteAccess() {
  parent.writeEnter(Thread.currentThread());
}

代码示例来源: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: in.jlibs/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 (IllegalStateException)new IllegalStateException().initCause(ex);
    }
    return;
  }
  Thread t = Thread.currentThread();
  writeEnter(t);
  try {
    action.run();
  } finally {
    leave(t);
  }
}

代码示例来源:origin: uk.gov.nationalarchives.thirdparty.netbeans/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: net.sf.squirrel-sql.thirdparty-non-maven/openide

/** 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 Object writeAccess (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();
  writeEnter(t);
  try {
    return action.run();
  } finally {
    leave(t);
  }
}

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

/** 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 Object writeAccess (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();
  writeEnter(t);
  try {
    return action.run();
  } finally {
    leave(t);
  }
}

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

writeEnter(t);
try {
  return action.run();

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

writeEnter(t);
try {
  return action.run();

代码示例来源:origin: in.jlibs/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: uk.gov.nationalarchives.thirdparty.netbeans/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: uk.gov.nationalarchives.thirdparty.netbeans/org-openide-util

writeEnter(t);

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

writeEnter(t);

相关文章