summaryrefslogtreecommitdiff
path: root/server/src/session.h
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/session.h')
-rw-r--r--server/src/session.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/server/src/session.h b/server/src/session.h
index a4d93f4..12c831a 100644
--- a/server/src/session.h
+++ b/server/src/session.h
@@ -31,6 +31,8 @@
#include <string>
#include <map>
+#include "mutex.h"
+
class JournalWriter;
class Session {
@@ -38,10 +40,18 @@ public:
Session(std::string sessionid);
std::string id();
+
+ void lock();
+ void unlock();
+
+ void commit();
+
+ JournalWriter *journal();
private:
- JournalWriter *journal;
+ JournalWriter *_journal;
std::string _id;
+ Mutex mutex;
};
class Sessions {
@@ -71,9 +81,13 @@ public:
*/
void deleteSession(std::string sessionid);
+ /**
+ * Return number of active sessions.
+ */
+ size_t size();
+
private:
std::map<std::string, Session *> sessions;
-
};