Difference between revisions of "r6.1.0:Thread state t"

From liblfds.org
Jump to navigation Jump to search
m (1 revision imported)
 
(No difference)

Latest revision as of 14:07, 4 January 2015

Source File

/test/src/abstraction.h

Typedef

typedef [type]  thread_state_t;

Notes

To abstract away the differences in thread state type on different platforms, liblfds uses a typedef.

Examples

On the pthread platform, there is a function, pthread_create, which is used to start threads and this function has the following prototype;

int pthread_create( pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)(void*), void *arg );

We see here that the caller passes in the address of a pthread_t and the function initalizes that variable. As such, on the pthreads platform, thread_state_t looks like this;

typedef pthread_t  thread_state_t

See Also