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 &s) {
36 unsigned long id() const {
40 bool is_closed() const {
44 /// mark session closed, can not be unset
51 unsigned long int m_id;
54 /// static mutex to lock static m_id
55 static boost::mutex m_mutex;
57 /// static m_id to make sure that there is only one id counter
58 static unsigned long int m_global_id;
64 // defining and initializing static members
65 boost::mutex yp2::Session::m_mutex;
66 unsigned long int yp2::Session::m_global_id = 0;
73 * indent-tabs-mode: nil
75 * vim: shiftwidth=4 tabstop=8 expandtab