7 #include <boost/thread/mutex.hpp>
16 /// returns next id, global state of id protected by boost::mutex
17 long unsigned int id() {
18 boost::mutex::scoped_lock scoped_lock(m_mutex);
23 // disabled because class is singleton
24 // Session(const Session &);
26 // disabled because class is singleton
27 // Session& operator=(const Session &);
29 /// static mutex to lock static m_id
30 static boost::mutex m_mutex;
32 /// static m_id to make sure that there is only one id counter
33 static unsigned long int m_id;
39 // initializing static members
40 boost::mutex yp2::Session::m_mutex;
41 unsigned long int yp2::Session::m_id = 0;
48 * indent-tabs-mode: nil
50 * vim: shiftwidth=4 tabstop=8 expandtab