4 \page l4re_pthreads Pthread Support
6 L4Re supports the standard pthread library functionality. Therefore L4Re
7 itself does not contain any documentation for pthreads itself. Please refer
8 to the standard pthread documentation instead.
10 The L4Re specific parts will be described herein.
14 Include pthread-l4.h header file:
16 #include <pthread-l4.h>
20 <li>Return the local thread capability of a pthread thread:
22 Use \c pthread_getl4cap(pthread_t *t) to get the capability index of
27 pthread_getl4cap(pthread_self());
31 <li> Setting the L4 priority of an L4 thread works with a special
32 scheduling policy (other policies do not affect the L4 thread
38 struct sched_param sp;
40 pthread_attr_init(&a);
41 sp.sched_priority = l4_priority;
42 pthread_attr_setschedpolicy(&a, SCHED_L4);
43 pthread_attr_setschedparam(&a, &sp);
44 pthread_attr_setinheritsched(&a, PTHREAD_EXPLICIT_SCHED);
46 if (pthread_create(&t, &a, pthread_func, NULL))
49 pthread_attr_destroy(&a);