Skip to content

Commit 0a46362

Browse files
committed
Adding uncancel() and clear() methods to ConcurrentCircularBuffer
1 parent e5e6845 commit 0a46362

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

include/cinder/ConcurrentCircularBuffer.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,17 @@ class ConcurrentCircularBuffer : private Noncopyable {
102102
mNotFullCond.notify_all();
103103
mNotEmptyCond.notify_all();
104104
}
105+
106+
void uncancel() {
107+
std::lock_guard<std::mutex> lock( mMutex );
108+
mCanceled = false;
109+
}
110+
111+
void clear() {
112+
std::lock_guard<std::mutex> lock( mMutex );
113+
mContainer.clear();
114+
mNotFullCond.notify_all();
115+
}
105116

106117
//! Returns the number of items the buffer can hold
107118
size_t getCapacity() const { return (size_t)mContainer.capacity(); }

0 commit comments

Comments
 (0)