ft_scheduler_t ft_scheduler_create (void);
ft_thread_t ft_thread_create (ft_scheduler_t scheduler,
void (*runnable)(void*),
void (*cleanup)(void*),
void *args);
ft_thread_t ft_automaton_create (ft_scheduler_t,
void (*automaton)(ft_thread_t),
void (*cleanup)(void*),
void *args);
ft_event_t ft_event_create (ft_scheduler_t scheduler);
int ft_scheduler_start (ft_scheduler_t scheduler);
int ft_scheduler_stop (ft_thread_t thread);
int ft_scheduler_suspend (ft_thread_t thread);
int ft_scheduler_resume (ft_thread_t thread);
int ft_scheduler_broadcast (ft_event_t event);
int ft_scheduler_broadcast_value (ft_event_t event,void *value);
int ft_thread_cooperate (void);
int ft_thread_cooperate_n (int num);
int ft_thread_join (ft_thread_t thread);
int ft_thread_join_n (ft_thread_t thread,int timeout);
int ft_thread_generate (ft_event_t event);
int ft_thread_generate_value (ft_event_t event,void *value);
int ft_thread_await (ft_event_t event);
int ft_thread_await_n (ft_event_t event,int timeout);
int ft_thread_select (int len,ft_event_t *array,int *mask);
int ft_thread_select_n (int len,ft_event_t *array,int *mask,int timeout);
int ft_thread_get_value (ft_event_t event,int num,void **result);
int ft_thread_link (ft_scheduler_t scheduler);
int ft_thread_unlink (void);
Current Thread and Scheduler
|
ft_thread_t ft_thread_self (void);
ft_scheduler_t ft_thread_scheduler (void);
void ft_exit (void);
int ft_thread_mutex_lock (pthread_mutex_t *mutex);
int ft_thread_mutex_unlock (pthread_mutex_t *mutex);
pthread_t ft_pthread (ft_thread_t thread);
AUTOMATON(name)
DEFINE_AUTOMATON(name)
BEGIN_AUTOMATON
END_AUTOMATON
STATE(num)
STATE_AWAIT(num,event)
STATE_AWAIT_N(num,event,delay)
STATE_GET_VALUE(num,event,n,result)
STATE_STAY(num,delay)
STATE_JOIN(num,thread)
STATE_JOIN_N(num,thread,delay)
STATE_SELECT(num,n,array,mask)
STATE_SELECT_N(num,n,array,mask,delay)
GOTO(num)
GOTO_NEXT
IMMEDIATE(num)
RETURN
SELF
SET_LOCAL(data)
LOCAL
ARGS
RETURN_CODE
|