1 2 3 4 5 6 7 8 9 10 11 12
#include <pthread.h> pthread_mutex_t mutex1; main() { pthread_mutex_init(&mutex1, NULL); pthread_mutex_trylock(&mutex1); pthread_mutex_unlock(&mutex1); return 0; }