We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1f62174 commit 62feca7Copy full SHA for 62feca7
1 file changed
libs/openFrameworks/utils/ofThreadChannel.h
@@ -266,6 +266,16 @@ class ofThreadChannel{
266
condition.notify_all();
267
}
268
269
+ /// \brief Clear channel.
270
+ ///
271
+ /// Clears the queue (useful if only the latest
272
+ /// data is meant to be transferred (i.e. no queue))
273
+ void clear() {
274
+ if (!queue.empty()) {
275
+ std::unique_lock<std::mutex> lock(mutex);
276
+ queue = {};
277
+ }
278
279
280
/// \brief Queries empty channel.
281
///
0 commit comments