ft_scheduler_stop,(1)

NAME
ft_scheduler_stop, ft_scheduler_suspend, ft_scheduler_resume - control threads running in a scheduler

  SYNOPSIS

#include <fthread.h>
int ft_scheduler_stop    (ft_thread_t th);
int ft_scheduler_suspend (ft_thread_t th);
int ft_scheduler_resume  (ft_thread_t th);

  DESCRIPTION

ft_scheduler_stop asks the scheduler running the thread th to force termination of it. Nothing special happens if the thread is already terminated. Otherwise, at the begining of the next instant, th executes the function cleanup if it exists, or otherwise terminates immediately.

ft_scheduler_suspend asks the scheduler running the thread th to suspend execution of it. The suspension will become actual at the beginning of the next instant of the scheduler.

 ft_scheduler_resume asks the scheduler running the thread th to resume execution of it. The resume will become actual at the beginning of the next instant of the scheduler. Suspension has higher priority than resume: if a thread is suspended and resumed during the same instant, then the thread will be suspended. A suspended thread which is stopped is first resumed.

  RETURN VALUES
On success, the value 0 is returned. On error, a non-zero error code is returned.

  ERRORS

    BADCREATE
        The thread th is not correctly created.

    BADLINK
        The thread th is unlinked.

    BADMEM
        Not enough memory (the order cannot be stored by the scheduler).

  SEE ALSO
ft_thread_create (3), ft_scheduler_create (3).

AUTHOR