7 #include <boost/thread/mutex.hpp>
13 //typedef unsigned long type;
16 /// create new session with new unique id
18 boost::mutex::scoped_lock scoped_lock(m_mutex);
24 /// copy session including old id
25 Session(const Session &s) : m_id(s.m_id), m_close(s.m_close) {};
27 //Session& operator=(const Session &);
29 unsigned long id() const {
33 bool is_closed() const {
37 /// mark session closed, can not be unset
44 unsigned long int m_id;
47 /// static mutex to lock static m_id
48 static boost::mutex m_mutex;
50 /// static m_id to make sure that there is only one id counter
51 static unsigned long int m_global_id;
57 // defining and initializing static members
58 boost::mutex yp2::Session::m_mutex;
59 unsigned long int yp2::Session::m_global_id = 0;
66 * indent-tabs-mode: nil
68 * vim: shiftwidth=4 tabstop=8 expandtab