Table of Contents

Name

qthread_schedule, qthread_schedule_on - enqueue a prepared but unscheduled qthread to run

Synopsis

#include <qthread/qthread.h>

int
qthread_schedule(qthread_t *t);

int
qthread_schedule_on(qthread_t *t, const qthread_shepherd_id_t shepherd);

Description

These are the companion functions to the qthread_prepare() functions. A qthread_t that was generated by one of those functions is scheduled to be run by one of these functions.

The qthread_schedule_on() function overrides the shepherd that the qthread was originally prepared for.

Functionally, qthread_fork(function, arg) is equivalent to:

qthread_schedule(qthread_prepare(function, arg));

Return Value

On success, the thread t is scheduled to run and 0 is returned. On error, a non-zero error code is returned.

Errors

ENOMEM
Not enough memory could be allocated for bookkeeping structures.

See Also

qthread_fork(3) , qthread_fork_to(3) , qthread_prepare(3) , qthread_prepare_for(3) , qthread_schedule(3) , qthread_schedule_on(3)


Table of Contents