NAME

catthread_start - start a new thread

SYNOPSIS

#include <cat/cat.h>

int catthread_start(void (*func(void *), void *arg);

DESCRIPTION

This function creates a new thread. If successful, the new thread begins execution in function func, which is given pointer arg as argument.

The catthread_start function returns as soon as the new thread has been created, and the new thread begins execution immediately. Any further synchronization between threads can be achieved using mutual exclusion locks and condition variables, as created by catmutex_init() and catmutex_cond_init() respectively.

RETURN VALUES

The function returns zero if successful, or a negative code on error. The value CAT_ENOTSUPP is returned on platforms where the library does not support threading.

SEE ALSO

cat, catutil