2 * iSCSI usermode single-threaded scheduler
4 * Copyright (C) 2004 Dmitry Yusupov, Alex Aizman
5 * maintained by open-iscsi@googlegroups.com
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published
9 * by the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * See the file COPYING included with this distribution for more details.
25 #define ACTOR_RESOLUTION 250 /* in millis */
26 #define ACTOR_MAX_LOOPS 1
28 typedef enum actor_state_e
{
36 typedef struct actor
{
37 struct list_head list
;
40 void (*callback
)(void * );
41 uint64_t scheduled_at
;
45 extern void actor_new(actor_t
*thread
, void (*callback
)(void *), void * data
);
46 extern void actor_delete(actor_t
*thread
);
47 extern void actor_schedule_head(actor_t
*thread
);
48 extern void actor_schedule(actor_t
*thread
);
49 extern void actor_timer(actor_t
*thread
, uint32_t timeout
,
50 void (*callback
)(void *), void *data
);
51 extern int actor_timer_mod(actor_t
*thread
, uint32_t new_timeout
, void *data
);
52 extern void actor_poll(void);
53 extern void actor_init(void);