diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-01-16 16:31:29 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-01-16 16:31:29 +0200 |
commit | 856a438b33184959b64864f1afdf5a6a2fd6b0d2 (patch) | |
tree | b1fd1d9c616262d8d62e4431469f74e5e74d4fe1 /common/session/custom/session.cxx | |
parent | 5cf30ccfe764701f549e4152ad312187221f5285 (diff) |
Make session cache management functions static, add notifications
Diffstat (limited to 'common/session/custom/session.cxx')
-rw-r--r-- | common/session/custom/session.cxx | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/common/session/custom/session.cxx b/common/session/custom/session.cxx index b50493f..f8cd102 100644 --- a/common/session/custom/session.cxx +++ b/common/session/custom/session.cxx @@ -6,33 +6,20 @@ #include "session.hxx" -static session* current_; // Use TLS in multi-threaded applications. +session* session::current; session:: session () { - assert (current_ == 0); - current_ = this; + assert (current == 0); + current = this; } session:: ~session () { - assert (current_ == this); - current_ = 0; -} - -bool session:: -has_current () -{ - return current_ != 0; -} - -session& session:: -current () -{ - assert (current_ != 0); - return *current_; + assert (current == this); + current = 0; } void session:: |