summaryrefslogtreecommitdiff
path: root/src/syncQueue.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/syncQueue.h')
-rw-r--r--src/syncQueue.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/syncQueue.h b/src/syncQueue.h
index f076b4a..5cb4f6e 100644
--- a/src/syncQueue.h
+++ b/src/syncQueue.h
@@ -46,7 +46,7 @@ class SyncQueue
public:
SyncQueue():syncServer_(NULL) {};
~SyncQueue() {};
-
+ static SyncQueue& instance();
void setSyncServerPtr(SyncServer *);
void push(const std::string & );
void push(const SyncCommand & );
@@ -54,10 +54,20 @@ public:
bool empty();
private:
+ static Mutex instMutex;
+ static SyncQueue* inst;
+ class instanceCleaner {
+ public: ~instanceCleaner() {
+ if(SyncQueue::inst != 0)
+ delete SyncQueue::inst;
+ }
+ };
SyncQueue(const SyncQueue &s);
void operator=(const SyncQueue &s);
Mutex mutex_;
SyncServer * syncServer_;
};
+extern SyncQueue& gSyncQueue;
+
#endif