2013-09-12 00:48:27 +02:00
|
|
|
/*
|
|
|
|
* \brief Kernel backend for asynchronous inter-process communication
|
|
|
|
* \author Martin Stein
|
|
|
|
* \date 2012-11-30
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2012-2013 Genode Labs GmbH
|
|
|
|
*
|
|
|
|
* This file is part of the Genode OS framework, which is distributed
|
|
|
|
* under the terms of the GNU General Public License version 2.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* core includes */
|
|
|
|
#include <kernel/signal_receiver.h>
|
|
|
|
|
2013-09-17 10:44:14 +02:00
|
|
|
using namespace Kernel;
|
2013-09-12 00:48:27 +02:00
|
|
|
|
2013-09-17 10:44:14 +02:00
|
|
|
|
2013-09-19 16:13:51 +02:00
|
|
|
void Signal_handler::_cancel_waiting()
|
2013-09-17 10:44:14 +02:00
|
|
|
{
|
2013-09-19 16:13:51 +02:00
|
|
|
if (_receiver) { _receiver->_handler_cancelled(this); }
|
2013-09-17 10:44:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-09-19 16:13:51 +02:00
|
|
|
void Signal_context_killer::_cancel_waiting()
|
2013-09-17 10:44:14 +02:00
|
|
|
{
|
2013-09-19 16:13:51 +02:00
|
|
|
if (_context) { _context->_killer_cancelled(); }
|
2013-09-17 10:44:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-09-19 16:13:51 +02:00
|
|
|
void Signal_receiver_killer::_cancel_waiting()
|
2013-09-17 10:44:14 +02:00
|
|
|
{
|
2013-09-19 16:13:51 +02:00
|
|
|
if (_receiver) { _receiver->_killer_cancelled(); }
|
2013-09-17 10:44:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Signal_context::_deliverable()
|
2013-09-12 00:48:27 +02:00
|
|
|
{
|
|
|
|
if (!_submits) return;
|
|
|
|
_receiver->_add_deliverable(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-09-17 10:44:14 +02:00
|
|
|
Signal_context::~Signal_context() { _receiver->_context_killed(this); }
|
|
|
|
|
2013-10-30 13:56:57 +01:00
|
|
|
|
|
|
|
Signal_context::Signal_context(Signal_receiver * const r)
|
|
|
|
:
|
|
|
|
_deliver_fe(this), _contexts_fe(this), _receiver(r),
|
|
|
|
_imprint(Object::id()), _submits(0), _ack(1), _kill(0), _killer(0)
|
|
|
|
{
|
|
|
|
r->add_context(this);
|
|
|
|
}
|