ABBCCDDA.c 314 B

123456789101112131415161718
  1. #include <liblockdep/mutex.h>
  2. #include "common.h"
  3. void main(void)
  4. {
  5. pthread_mutex_t a, b, c, d;
  6. pthread_mutex_init(&a, NULL);
  7. pthread_mutex_init(&b, NULL);
  8. pthread_mutex_init(&c, NULL);
  9. pthread_mutex_init(&d, NULL);
  10. LOCK_UNLOCK_2(a, b);
  11. LOCK_UNLOCK_2(b, c);
  12. LOCK_UNLOCK_2(c, d);
  13. LOCK_UNLOCK_2(d, a);
  14. }