Fixed OpenSSL recv loop quitting too early

This commit is contained in:
Paul-Louis Ageneau
2020-09-27 23:53:35 +02:00
parent 635c2e5513
commit 458decb12d
2 changed files with 8 additions and 3 deletions

View File

@ -38,6 +38,7 @@ public:
~Queue();
void stop();
bool running() const;
bool empty() const;
bool full() const;
size_t size() const; // elements
@ -80,6 +81,11 @@ template <typename T> void Queue<T>::stop() {
mPushCondition.notify_all();
}
template <typename T> bool Queue<T>::running() const {
std::lock_guard lock(mMutex);
return !mQueue.empty() || !mStopping;
}
template <typename T> bool Queue<T>::empty() const {
std::lock_guard lock(mMutex);
return mQueue.empty();