本文整理了Java中org.openide.util.Mutex.doEvent()
方法的一些代码示例,展示了Mutex.doEvent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Mutex.doEvent()
方法的具体详情如下:
包路径:org.openide.util.Mutex
类名称:Mutex
方法名:doEvent
[英]Runs the runnable in event queue, either immediatelly, or it posts it into the queue.
[中]立即运行可运行事件队列,或将其发布到队列中。
代码示例来源: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: 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 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: 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: in.jlibs/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 (IllegalStateException)new IllegalStateException().initCause(ex);
}
}
Thread t = Thread.currentThread();
readEnter(t);
try {
action.run();
} finally {
leave(t);
}
}
代码示例来源:origin: uk.gov.nationalarchives.thirdparty.netbeans/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: 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);
}
}
内容来源于网络,如有侵权,请联系作者删除!