aboutsummaryrefslogtreecommitdiffstats
path: root/fnet/src/vespa/fnet/task.cpp
blob: 7202391ee3a5024191c3ccb0658b346df60c2f8b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "task.h"
#include "scheduler.h"

FNET_Task::FNET_Task(FNET_Scheduler *scheduler)
    : _task_scheduler(scheduler),
      _task_slot(0),
      _task_iter(0),
      _task_next(nullptr),
      _task_prev(nullptr),
      _killed(false)
{
}


FNET_Task::~FNET_Task() = default;


void
FNET_Task::Schedule(double seconds)
{
    _task_scheduler->Schedule(this, seconds);
}


void
FNET_Task::ScheduleNow()
{
    _task_scheduler->ScheduleNow(this);
}


void
FNET_Task::Unschedule()
{
    _task_scheduler->Unschedule(this);
}


void
FNET_Task::Kill()
{
    _task_scheduler->Kill(this);
}


void
FNET_Task::PerformTask()
{
}