| lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | #include <pthread.h> | 
|  | 2 | #include <stdio.h> | 
|  | 3 | #include <stdlib.h> | 
|  | 4 |  | 
|  | 5 |  | 
|  | 6 | pthread_mutexattr_t a; | 
|  | 7 | pthread_mutexattr_t *attr; | 
|  | 8 |  | 
|  | 9 | static void | 
|  | 10 | prepare (void) | 
|  | 11 | { | 
|  | 12 | attr = &a; | 
|  | 13 | if (pthread_mutexattr_init (&a) != 0) | 
|  | 14 | { | 
|  | 15 | puts ("mutexattr_init failed"); | 
|  | 16 | exit (1); | 
|  | 17 | } | 
|  | 18 |  | 
|  | 19 | if (pthread_mutexattr_setprotocol (&a, PTHREAD_PRIO_INHERIT) != 0) | 
|  | 20 | { | 
|  | 21 | puts ("mutexattr_setprotocol failed"); | 
|  | 22 | exit (1); | 
|  | 23 | } | 
|  | 24 | } | 
|  | 25 | #define PREPARE(argc, argv) prepare () | 
|  | 26 |  | 
|  | 27 |  | 
|  | 28 | #define ATTR attr | 
|  | 29 | #include "tst-mutex6.c" |