+ public:
+ /** Notifies parent by making the SignalFD ready to read
+ * No requirements on locking
+ */
+ void NotifyParent();
+ SocketThread();
+ virtual ~SocketThread();
+ /** Lock queue.
+ */
+ void LockQueue()
+ {
+ queue.Lock();
+ }
+ /** Unlock queue.
+ */
+ void UnlockQueue()
+ {
+ queue.Unlock();
+ }
+ /** Unlock queue and send wakeup to worker
+ */
+ void UnlockQueueWakeup()
+ {
+ queue.Wakeup();
+ queue.Unlock();
+ }
+ virtual void SetExitFlag()
+ {
+ queue.Lock();
+ Thread::SetExitFlag();
+ queue.Wakeup();
+ queue.Unlock();
+ }
+
+ /**
+ * Called in the context of the parent thread after a notification
+ * has passed through the socket
+ */
+ virtual void OnNotify() = 0;