2 /* Simple pthread example using pthread_mutex to ensure mutual exclusion */
3 /* This corrects the bug from raceexample.c */
4 /* To compile me for Linux, type: gcc -o filename filename.c -lpthread */
5 /* To execute, type: filename */
10 #include <sys/resource.h>
13 pthread_mutex_t mut1
=PTHREAD_MUTEX_INITIALIZER
;
14 pthread_spinlock_t spin1
;
19 printf("pthread_cond_t\t%zd\n",sizeof(cond1
));
20 printf("pthread_spinlock_t\t%zd\n",sizeof(spin1
));
21 printf("pthread_mutex_t\t%zd\n",sizeof(mut1
));