7 /* Delete memory that has a held lock and see what happens. */
9 typedef struct { int stuff
[2000];
10 pthread_mutex_t lock
; int morestuff
[2000]; } XX
;
17 XX
* xx
= malloc(sizeof(XX
));
20 pthread_mutex_init( &xx
->lock
, NULL
);
22 pthread_mutex_lock( &xx
->lock
);
33 /* Try the same, on the stack */
36 pthread_mutex_t mx
= PTHREAD_MUTEX_INITIALIZER
;
37 // pthread_mutex_init( &mx, NULL );
38 pthread_mutex_lock( &mx
);
39 /* now just abandon mx */
46 pthread_mutex_init( &mx
, NULL
);
47 pthread_mutex_lock( &mx
);
48 /* now just abandon mx */