aboutsummaryrefslogtreecommitdiff
path: root/libitm/dispatch.h
diff options
context:
space:
mode:
authorTorvald Riegel <triegel@redhat.com>2012-10-24 19:52:02 +0000
committerTorvald Riegel <torvald@gcc.gnu.org>2012-10-24 19:52:02 +0000
commitb679c81340ece3ceecbd74d46a1af6fe473813bc (patch)
treeeb6dab1987f0c9c1f49fce76ba1dd1d8267e3277 /libitm/dispatch.h
parent1a6c552d12026ee85c819dfe6f2c83bc59aaa28f (diff)
downloadgcc-b679c81340ece3ceecbd74d46a1af6fe473813bc.zip
gcc-b679c81340ece3ceecbd74d46a1af6fe473813bc.tar.gz
gcc-b679c81340ece3ceecbd74d46a1af6fe473813bc.tar.bz2
Ask dispatch whether it requires serial mode.
* retry.cc (gtm_thread::decide_begin_dispatch): Ask dispatch whether it requires serial mode instead of assuming that for certain dispatchs. * dispatch.h (abi_dispatch::requires_serial): New. (abi_dispatch::abi_dispatch): Adapt. * method-gl.cc (gl_wt_dispatch::gl_wt_dispatch): Adapt. * method-ml.cc (ml_wt_dispatch::ml_wt_dispatch): Same. * method-serial.cc (serialirr_dispatch::serialirr_dispatch, serial_dispatch::serial_dispatch, serialirr_onwrite_dispatch::serialirr_onwrite_dispatch): Same. From-SVN: r192777
Diffstat (limited to 'libitm/dispatch.h')
-rw-r--r--libitm/dispatch.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/libitm/dispatch.h b/libitm/dispatch.h
index 6a9e62e..200138b 100644
--- a/libitm/dispatch.h
+++ b/libitm/dispatch.h
@@ -311,6 +311,9 @@ public:
}
// Returns true iff this TM method supports closed nesting.
bool closed_nesting() const { return m_closed_nesting; }
+ // Returns STATE_SERIAL or STATE_SERIAL | STATE_IRREVOCABLE iff the TM
+ // method only works for serial-mode transactions.
+ uint32_t requires_serial() const { return m_requires_serial; }
method_group* get_method_group() const { return m_method_group; }
static void *operator new(size_t s) { return xmalloc (s); }
@@ -332,12 +335,14 @@ protected:
const bool m_write_through;
const bool m_can_run_uninstrumented_code;
const bool m_closed_nesting;
+ const uint32_t m_requires_serial;
method_group* const m_method_group;
abi_dispatch(bool ro, bool wt, bool uninstrumented, bool closed_nesting,
- method_group* mg) :
+ uint32_t requires_serial, method_group* mg) :
m_read_only(ro), m_write_through(wt),
m_can_run_uninstrumented_code(uninstrumented),
- m_closed_nesting(closed_nesting), m_method_group(mg)
+ m_closed_nesting(closed_nesting), m_requires_serial(requires_serial),
+ m_method_group(mg)
{ }
};