Table of Contents

Name

qthread_migrate_to - relocate a qthread to the target shepherd

Synopsis

#include <qthread/qthread.h>

int
qthread_migrate_to(qthread_t * const me, qthread_shepherd_id_t shepherd);

Description

This is the function for moving a qthread to a different shepherd.

The first argument, me, is the qthread_t pointer of the current qthread. If the me argument is NULL, the correct value will be discovered automatically (similar to using qthread_self()), but this lookup may be expensive. The second argument, shepherd, is the identifier of the shepherd to move to.

When the call returns, the qthread will be running on the specified shepherd.

Return Value

On success, 0 is returned. On error, a non-zero error code is returned.

Errors

QTHREAD_BADARGS
Either the me value was invalid or the shepherd was too large.

See Also

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


Table of Contents