aboutsummaryrefslogtreecommitdiff
path: root/odb/session.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/session.cxx')
-rw-r--r--odb/session.cxx29
1 files changed, 11 insertions, 18 deletions
diff --git a/odb/session.cxx b/odb/session.cxx
index 3ca6af4..0f18684 100644
--- a/odb/session.cxx
+++ b/odb/session.cxx
@@ -21,7 +21,7 @@ namespace odb
if (has_current ())
throw already_in_session ();
- current (*this);
+ current_pointer (this);
}
}
@@ -30,14 +30,20 @@ namespace odb
{
// If we are the current thread's session, reset it.
//
- if (has_current () && &current () == this)
+ if (current_pointer () == this)
reset_current ();
}
- bool session::
- has_current ()
+ session* session::
+ current_pointer ()
{
- return tls_get (current_session) != 0;
+ return tls_get (current_session);
+ }
+
+ void session::
+ current_pointer (session* s)
+ {
+ tls_set (current_session, s);
}
session& session::
@@ -51,19 +57,6 @@ namespace odb
return *cur;
}
- void session::
- current (session& s)
- {
- tls_set (current_session, &s);
- }
-
- void session::
- reset_current ()
- {
- session* s (0);
- tls_set (current_session, s);
- }
-
//
// object_map_base
//