From cb36d9656929ad30f7378fd81caad8b20dcac8d5 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Mon, 21 Jan 2019 10:59:40 +0100 Subject: [PATCH] netperf: remove mechanism to update 'times_up' The mechanism relied on deprecated Genode APIs. To revive the mechanism, we could use pthread_create. --- repos/ports/src/app/netperf/timer.cc | 69 +--------------------------- 1 file changed, 2 insertions(+), 67 deletions(-) diff --git a/repos/ports/src/app/netperf/timer.cc b/repos/ports/src/app/netperf/timer.cc index be8b879865..1b09860350 100644 --- a/repos/ports/src/app/netperf/timer.cc +++ b/repos/ports/src/app/netperf/timer.cc @@ -11,79 +11,14 @@ * under the terms of the GNU Affero General Public License version 3. */ -#include -#include -#include - - -using namespace Genode; - -class Alarm_thread : Thread_deprecated<2048*sizeof(long)>, public Alarm_scheduler -{ - private: - - Timer::Connection _timer; - Alarm::Time _curr_time; /* jiffies value */ - - enum { TIMER_GRANULARITY_MSEC = 10 }; - - /** - * Thread entry function - */ - void entry() - { - while (true) { - _timer.msleep(TIMER_GRANULARITY_MSEC); - Alarm_scheduler::handle(_curr_time); - _curr_time += TIMER_GRANULARITY_MSEC; - } - } - - public: - - /** - * Constructor - */ - Alarm_thread(): Thread_deprecated("netperf_alarm"), _curr_time(0) { start(); } - - Alarm::Time curr_time() { return _curr_time; } -}; - +#include /* defined in "ports/contrib/netperf/src/netlib.c" */ extern "C" int times_up; -class One_shot : public Alarm -{ - private: - - Alarm_scheduler *_scheduler; - - public: - - One_shot(Alarm_scheduler *scheduler) : _scheduler(scheduler) { } - - void set_timeout(Time absolute_timeout) - { - _scheduler->schedule_absolute(this, absolute_timeout); - } - - protected: - - bool on_alarm(unsigned) override - { - times_up = 1; - return false; - } -}; - - extern "C" void start_timer(int time) { - static Alarm_thread alarm_thread; - static One_shot oneshot(&alarm_thread); - - oneshot.set_timeout(alarm_thread.curr_time() + time * 1000); + Genode::warning(__func__, " not implemented, 'times_up' is never updated"); }