timed_semaphore: fix deprecated warning

Fixes #2429
This commit is contained in:
Christian Prochaska 2017-05-23 15:10:20 +02:00 committed by Christian Helmuth
parent a507928cde
commit 16deaa9a72
3 changed files with 12 additions and 1 deletions

View File

@ -19,6 +19,7 @@
#include <util/string.h>
#include <base/thread.h>
#include <base/heap.h>
#include <os/timed_semaphore.h>
/* base-internal includes */
#include <base/internal/unmanaged_singleton.h>
@ -679,6 +680,9 @@ void Component::construct(Genode::Env &env)
Link_map::dump();
/* FIXME: remove 'Timeout_thread' from the base library */
Timeout_thread::env(env);
binary_ready_hook_for_gdb();
/* start binary */

View File

@ -47,7 +47,9 @@ class Genode::Timeout_thread : public Thread_deprecated<2048*sizeof(long)>,
enum { JIFFIES_STEP_MS = 10 };
Timer::Connection _timer; /* timer session */
static Genode::Env *_env;
Timer::Connection _timer { *_env }; /* timer session */
Signal_context _context;
Signal_receiver _receiver;
@ -68,6 +70,8 @@ class Genode::Timeout_thread : public Thread_deprecated<2048*sizeof(long)>,
* Returns the singleton timeout-thread used for all timeouts.
*/
static Timeout_thread *alarm_timer();
static void env(Genode::Env &env) { _env = &env; }
};

View File

@ -14,6 +14,9 @@
#include <os/timed_semaphore.h>
Genode::Env *Genode::Timeout_thread::_env = nullptr;
void Genode::Timeout_thread::entry()
{
while (true) {