From 856a438b33184959b64864f1afdf5a6a2fd6b0d2 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 16 Jan 2013 16:31:29 +0200 Subject: Make session cache management functions static, add notifications --- common/session/custom/session.cxx | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'common/session/custom/session.cxx') 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:: -- cgit v1.1