diff options
author | Torvald Riegel <triegel@redhat.com> | 2012-02-14 13:14:12 +0000 |
---|---|---|
committer | Torvald Riegel <torvald@gcc.gnu.org> | 2012-02-14 13:14:12 +0000 |
commit | 5b9cf5d2bf66a36b0716e07044d492b91dd835a2 (patch) | |
tree | 0c010bcc192851eb16058d7cb732414acc193075 /libitm/dispatch.h | |
parent | 7d33bcb73866d5310b4eb190172240bcb71f51f6 (diff) | |
download | gcc-5b9cf5d2bf66a36b0716e07044d492b91dd835a2.zip gcc-5b9cf5d2bf66a36b0716e07044d492b91dd835a2.tar.gz gcc-5b9cf5d2bf66a36b0716e07044d492b91dd835a2.tar.bz2 |
libitm: Improve method reinit and choice.
libitm/
* dispatch.h (GTM::abi_dispatch::supports): New.
(GTM::method_group::reinit): New.
* retry.cc (GTM::gtm_thread::decide_retry_strategy): Use reinit().
(GTM::gtm_thread::number_of_threads_changed): Check that the method
supports the current situation.
From-SVN: r184211
Diffstat (limited to 'libitm/dispatch.h')
-rw-r--r-- | libitm/dispatch.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libitm/dispatch.h b/libitm/dispatch.h index dbf05e4..d059c49 100644 --- a/libitm/dispatch.h +++ b/libitm/dispatch.h @@ -245,6 +245,12 @@ struct method_group // Stop using any method from this group for now. This can be used to // destruct meta data as soon as this method group is not used anymore. virtual void fini() = 0; + // This can be overriden to implement more light-weight re-initialization. + virtual void reinit() + { + fini(); + init(); + } }; @@ -290,6 +296,10 @@ public: // method on begin of a nested transaction without committing or restarting // the parent method. virtual abi_dispatch* closed_nesting_alternative() { return 0; } + // Returns true iff this method group supports the current situation. + // NUMBER_OF_THREADS is the current number of threads that might execute + // transactions. + virtual bool supports(unsigned number_of_threads) { return true; } bool read_only () const { return m_read_only; } bool write_through() const { return m_write_through; } |