public void enterReadAccess() { parent.readEnter(Thread.currentThread()); }
/** 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); } }
/** 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); } }
public void enterReadAccess() { parent.readEnter(Thread.currentThread()); }
public void enterReadAccess() { parent.readEnter(Thread.currentThread()); }
/** 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); } }
/** 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); } }
/** 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); } }
/** 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); } }
/** 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); } }
/** 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); } }
readEnter(t); try { return action.run();
readEnter(t); try { return action.run();
/** 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); } }
/** 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); } }