6 static pthread_mutex_t mx
= PTHREAD_MUTEX_INITIALIZER
;
11 static void breakme(void)
14 memset (ptr
, 0x55, 1000);
17 static void *th(void *v
)
19 pthread_mutex_lock(&mx
);
29 pthread_mutex_unlock(&mx
);
38 pthread_mutex_lock(&mx
);
39 pthread_mutex_unlock(&mx
);
41 pthread_create(&a
, NULL
, th
, NULL
);
42 pthread_create(&b
, NULL
, th
, NULL
);
44 pthread_join(a
, NULL
);
45 pthread_join(b
, NULL
);