@Override protected void backendCommit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException { jvstm.Transaction.commit(); }
@Override public void commit() { jvstm.Transaction.commit(); }
@Override protected void backendCommit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException { if (Transaction.current() != underlyingTransaction) { throw new IllegalStateException("JVSTM does not support committing transactions from other threads!"); } try { Transaction.commit(); } catch (CommitException e) { throw new JvstmCommitError(); } }
@Override protected void backendCommit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException { if (Transaction.current() != underlyingTransaction) { throw new IllegalStateException("JVSTM does not support committing transactions from other threads!"); } try { Transaction.commit(); } catch (CommitException e) { throw new JvstmTransactionError(); } }
private static <T extends VBoxAom<T>> void putInInevitableTrx(T ref, long newValue, long fieldOffset){ Transaction tx = Transaction.beginInevitable(); T newT = getTargetForInnevitable(ref, tx.number); UtilUnsafe.UNSAFE.putLong(newT, fieldOffset, newValue); tx.setBoxValue(ref, newT); tx.commit(); }
private static <T extends VBoxAom<T>> void putInInevitableTrx(T ref, byte newValue, long fieldOffset){ Transaction tx = Transaction.beginInevitable(); T newT = getTargetForInnevitable(ref, tx.number); UtilUnsafe.UNSAFE.putByte(newT, fieldOffset, newValue); tx.setBoxValue(ref, newT); tx.commit(); }
@Override public <T> T withTransaction(CallableWithoutException<T> command) { jvstm.Transaction.beginInevitable(); currentJPATx.set(new JVSTMMemTransaction()); T res = command.call(); jvstm.Transaction.commit(); return res; }
private static <T extends VBoxAom<T>> void putInInevitableTrx(T ref, Object newValue, long fieldOffset){ Transaction tx = Transaction.beginInevitable(); T newT = getTargetForInnevitable(ref, tx.number); UtilUnsafe.UNSAFE.putObject(newT, fieldOffset, newValue); tx.setBoxValue(ref, newT); tx.commit(); }
private static <T extends VBoxAom<T>> void putInInevitableTrx(T ref, int newValue, long fieldOffset){ Transaction tx = Transaction.beginInevitable(); T newT = getTargetForInnevitable(ref, tx.number); UtilUnsafe.UNSAFE.putInt(newT, fieldOffset, newValue); tx.setBoxValue(ref, newT); tx.commit(); }
private static <T extends VBoxAom<T>> void putInInevitableTrx(T ref, short newValue, long fieldOffset){ Transaction tx = Transaction.beginInevitable(); T newT = getTargetForInnevitable(ref, tx.number); UtilUnsafe.UNSAFE.putShort(newT, fieldOffset, newValue); tx.setBoxValue(ref, newT); tx.commit(); }
private static <T extends VBoxAom<T>> void putInInevitableTrx(T ref, double newValue, long fieldOffset){ Transaction tx = Transaction.beginInevitable(); T newT = getTargetForInnevitable(ref, tx.number); UtilUnsafe.UNSAFE.putDouble(newT, fieldOffset, newValue); tx.setBoxValue(ref, newT); tx.commit(); }
public void put(E newE) { Transaction tx = Transaction.current(); if (tx == null) { tx = Transaction.beginInevitable(); tx.setBoxValue(this, newE); tx.commit(); } else { tx.setBoxValue(this, newE); } }
public void put(E newE) { Transaction tx = Transaction.current(); if (tx == null) { tx = Transaction.begin(); tx.setPerTxValue(this, newE); tx.commit(); } else { tx.setPerTxValue(this, newE); } }
private static <T extends VBoxAom<T>> void putInInevitableTrx(T ref, float newValue, long fieldOffset){ Transaction tx = Transaction.beginInevitable(); T newT = getTargetForInnevitable(ref, tx.number); UtilUnsafe.UNSAFE.putFloat(newT, fieldOffset, newValue); tx.setBoxValue(ref, newT); tx.commit(); }
public E get() { Transaction tx = Transaction.current(); if (tx == null) { tx = Transaction.begin(); E result = tx.getPerTxValue(this, initial); tx.commit(); return result; } else { return tx.getPerTxValue(this, initial); } }
private static <T extends VBoxAom<T>> void putInInevitableTrx(T ref, boolean newValue, long fieldOffset){ Transaction tx = Transaction.beginInevitable(); T newT = getTargetForInnevitable(ref, tx.number); UtilUnsafe.UNSAFE.putBoolean(newT, fieldOffset, newValue); tx.setBoxValue(ref, newT); tx.commit(); }
private static <T extends VBoxAom<T>> void putInInevitableTrx(T ref, char newValue, long fieldOffset){ Transaction tx = Transaction.beginInevitable(); T newT = getTargetForInnevitable(ref, tx.number); UtilUnsafe.UNSAFE.putChar(newT, fieldOffset, newValue); tx.setBoxValue(ref, newT); tx.commit(); } private static <T extends VBoxAom<T>> void putInInevitableTrx(T ref, float newValue, long fieldOffset){
public static void transactionallyDo(TransactionalCommand command) { while (true) { Transaction tx = Transaction.begin(); try { command.doIt(); tx.commit(); tx = null; return; } catch (CommitException ce) { tx.abort(); tx = null; } finally { if (tx != null) { tx.abort(); } } } }
@SuppressWarnings("static-access") public void put(int index, E newE) { rangeCheck(index); Transaction tx = Transaction.current(); if (tx == null) { tx = Transaction.begin(); tx.setArrayValue(new VArrayEntry<E>(this, index), newE); tx.commit(); } else { tx.setArrayValue(new VArrayEntry<E>(this, index), newE); } }
@SuppressWarnings("static-access") public E get(int index) { rangeCheck(index); // TODO: Apply the same optimization as in VBox.get() Transaction tx = Transaction.current(); if (tx == null) { tx = Transaction.begin(true); E value = tx.getArrayValue(new VArrayEntry<E>(this, index)); tx.commit(); return value; } else { return tx.getArrayValue(new VArrayEntry<E>(this, index)); } }