mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 20:42:56 +01:00
os: Add Input::Event_queue::reset function
Resetting the input-event queue is useful for error handling. Issue #1185
This commit is contained in:
@@ -78,6 +78,8 @@ class Input::Event_queue
|
||||
bool empty() const { return _queue.empty(); }
|
||||
|
||||
int avail_capacity() const { return _queue.avail_capacity(); }
|
||||
|
||||
void reset() { _queue.reset(); }
|
||||
};
|
||||
|
||||
#endif /* _EVENT_QUEUE_H_ */
|
||||
|
||||
@@ -132,6 +132,11 @@ class Ring_buffer
|
||||
else
|
||||
return _tail - _head - 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Discard all ring-buffer elements
|
||||
*/
|
||||
void reset() { _head = _tail; }
|
||||
};
|
||||
|
||||
#endif /* _INCLUDE__OS__RING_BUFFER_H_ */
|
||||
|
||||
Reference in New Issue
Block a user