mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-31 08:25:38 +00: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:
parent
bb83c0d3da
commit
b6f8bcca6a
@ -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_ */
|
||||
|
Loading…
x
Reference in New Issue
Block a user