/** 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 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); } }
return doEventAccess(action);
return doEventAccess(action);
/** 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); } }
/** 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); } }
/** 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); } }
return doEventAccess (action);
return doEventAccess (action);
/** 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); } }
/** 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); } }
/** 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); } }
return doEventAccess(action);
return doEventAccess(action);