summaryrefslogtreecommitdiff
path: root/src/smt_util/node_visitor.h
diff options
context:
space:
mode:
authorAndres Noetzli <andres.noetzli@gmail.com>2017-08-30 20:55:27 -0700
committerGitHub <noreply@github.com>2017-08-30 20:55:27 -0700
commit546d795470ca7c30fc62fe9b6c7b8e5838e1eed4 (patch)
tree443f7101c4246b684ce21a04704d769eb2db15ad /src/smt_util/node_visitor.h
parentd7dadde871ae4775748695b0b7f9deee49576c0a (diff)
Use thread_local instead of compiler extensions (#210)
C++11 introduced the thread_local keyword, so we don't need to use non-standard extensions or our custom pthread extension anymore. The behavior was previously introduced as a workaround in commit 753a072c542c1c254d7c6adbf10e091ba585ede5. This commit introduces the macro CVC4_THREAD_LOCAL that can be used to declare variables as thread local. For Swig, this macro is defined to be empty.
Diffstat (limited to 'src/smt_util/node_visitor.h')
-rw-r--r--src/smt_util/node_visitor.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/smt_util/node_visitor.h b/src/smt_util/node_visitor.h
index 8c02af82d..ffd05c83f 100644
--- a/src/smt_util/node_visitor.h
+++ b/src/smt_util/node_visitor.h
@@ -20,6 +20,7 @@
#include <vector>
+#include "base/tls.h"
#include "expr/node.h"
namespace CVC4 {
@@ -32,7 +33,7 @@ template<typename Visitor>
class NodeVisitor {
/** For re-entry checking */
- static CVC4_THREADLOCAL(bool) s_inRun;
+ static CVC4_THREAD_LOCAL bool s_inRun;
/**
* Guard against NodeVisitor<> being re-entrant.
@@ -73,7 +74,7 @@ public:
*/
static typename Visitor::return_type run(Visitor& visitor, TNode node) {
- GuardReentry<CVC4_THREADLOCAL_TYPE(bool)> guard(s_inRun);
+ GuardReentry<bool> guard(s_inRun);
// Notify of a start
visitor.start(node);
@@ -115,6 +116,6 @@ public:
};/* class NodeVisitor<> */
template <typename Visitor>
-CVC4_THREADLOCAL(bool) NodeVisitor<Visitor>::s_inRun = false;
+CVC4_THREAD_LOCAL bool NodeVisitor<Visitor>::s_inRun = false;
}/* CVC4 namespace */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback