/** 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 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); } }
/** 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); } }
/** 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); } }
/** 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 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); } }
/** 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 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); } }