mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-19 05:37:54 +00:00
base: Local signal submit
This commit is contained in:
parent
50d73e7890
commit
864a047206
@ -170,6 +170,16 @@ namespace Genode {
|
||||
*/
|
||||
virtual ~Signal_context() { }
|
||||
|
||||
/**
|
||||
* Local sginal submission (DEPRECATED)
|
||||
*
|
||||
* Trigger local signal submission (within the same address space), the
|
||||
* context has to be bound to a sginal receiver beforehand.
|
||||
*
|
||||
* \param num number of pending signals
|
||||
*/
|
||||
void submit(unsigned num);
|
||||
|
||||
/*
|
||||
* Signal contexts are never invoked but only used as arguments for
|
||||
* 'Signal_session' functions. Hence, there exists a capability
|
||||
@ -343,7 +353,7 @@ namespace Genode {
|
||||
* \param T type of signal-handling class
|
||||
*/
|
||||
template <typename T>
|
||||
class Signal_dispatcher : private Signal_dispatcher_base,
|
||||
class Signal_dispatcher : public Signal_dispatcher_base,
|
||||
public Signal_context_capability
|
||||
{
|
||||
private:
|
||||
|
@ -199,6 +199,31 @@ Signal::Signal(Signal::Data data) : _data(data)
|
||||
}
|
||||
|
||||
|
||||
/********************
|
||||
** Signal context **
|
||||
********************/
|
||||
|
||||
void Signal_context::submit(unsigned num)
|
||||
{
|
||||
if (!_receiver) {
|
||||
PWRN("signal context with no receiver");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!signal_context_registry()->test_and_lock(this)) {
|
||||
PWRN("encountered dead signal context");
|
||||
return;
|
||||
}
|
||||
|
||||
/* construct and locally submit signal object */
|
||||
Signal::Data signal(this, num);
|
||||
_receiver->local_submit(signal);
|
||||
|
||||
/* free context lock that was taken by 'test_and_lock' */
|
||||
_lock.unlock();
|
||||
}
|
||||
|
||||
|
||||
/************************
|
||||
** Signal transmitter **
|
||||
************************/
|
||||
|
Loading…
Reference in New Issue
Block a user