genode/ports/src/noux/wake_up_notifier.h

39 lines
696 B
C
Raw Normal View History

2011-12-22 16:19:25 +01:00
/*
* \brief Utility for implementing blocking syscalls
* \author Norman Feske
* \date 2011-11-05
*/
/*
2013-01-10 21:44:47 +01:00
* Copyright (C) 2011-2013 Genode Labs GmbH
2011-12-22 16:19:25 +01:00
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#ifndef _NOUX__WAKE_UP_NOTIFIER__H_
#define _NOUX__WAKE_UP_NOTIFIER__H_
/* Genode includes */
#include <util/list.h>
#include <base/lock.h>
2011-12-22 16:19:25 +01:00
namespace Noux {
struct Wake_up_notifier : List<Wake_up_notifier>::Element
2011-12-22 16:19:25 +01:00
{
Lock *lock;
2011-12-22 16:19:25 +01:00
Wake_up_notifier(Lock *lock = 0)
: lock(lock) { }
2011-12-22 16:19:25 +01:00
void wake_up()
{
if (lock)
lock->unlock();
2011-12-22 16:19:25 +01:00
}
};
};
#endif /* _NOUX__WAKE_UP_NOTIFIER__H_ */