-/* Copyright (C) 2008-2013 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2019 Free Software Foundation, Inc.
Contributed by Richard Henderson <rth@redhat.com>.
This file is part of the GNU Transactional Memory Library (libitm).
virtual gtm_restart_reason begin_or_restart() { return NO_RESTART; }
virtual bool trycommit(gtm_word& priv_time) { return true; }
virtual void rollback(gtm_transaction_cp *cp) { abort(); }
+ virtual bool snapshot_most_recent() { return true; }
virtual abi_dispatch* closed_nesting_alternative()
{
// Local undo will handle this.
// trydropreference() need not be changed either.
virtual void rollback(gtm_transaction_cp *cp) { }
+ virtual bool snapshot_most_recent() { return true; }
CREATE_DISPATCH_METHODS(virtual, )
CREATE_DISPATCH_METHODS_MEM()
if (tx->state & gtm_thread::STATE_IRREVOCABLE)
abort();
}
+
+ virtual bool snapshot_most_recent() { return true; }
};
// This group is pure HTM with serial mode as a fallback. There is no
// Enable the HTM fastpath if the HW is available. The fastpath is
// initially disabled.
#ifdef USE_HTM_FASTPATH
- htm_fastpath = htm_init();
+ gtm_thread::serial_lock.set_htm_fastpath(htm_init());
#endif
}
virtual void fini()
{
// Disable the HTM fastpath.
- htm_fastpath = 0;
+ gtm_thread::serial_lock.set_htm_fastpath(0);
}
};
#if defined(USE_HTM_FASTPATH)
// HTM fastpath. If we are executing a HW transaction, don't go serial but
// continue. See gtm_thread::begin_transaction.
- if (likely(htm_fastpath && !gtm_thread::serial_lock.is_write_locked()))
+ if (likely(!gtm_thread::serial_lock.htm_fastpath_disabled()))
return;
#endif
// We're already serial, so we don't need to ensure privatization safety
// for other transactions here.
gtm_word priv_time = 0;
- bool ok = disp->trycommit (priv_time);
+ bool ok __attribute__((unused)) = disp->trycommit (priv_time);
// Given that we're already serial, the trycommit better work.
assert (ok);
}