Debugging threads with HP Wilde Beest

/* Rest of application code here */
/*
* Create a thread
*/
ret_val = pthread_create(&tid1, (pthread_attr_t *)NULL,
(void *(*)())start_routine, (void *)1);
check_error(ret_val, "pthread_create 1 failed");
/*
* Wait for the threads to finish
*/
ret_val = pthread_join(tid1, (void **)NULL);
check_error(ret_val, "pthread_join: tid1");
}
void
start_routine(int thread_num)
{
int ret_val;
sched_yield();
/* Lock the recursive lock recursively. */
ret_val = pthread_mutex_lock(&r_mtx);
check_error(ret_val, "mutex_lock r_mtx");
printf("Thread %d - got r_mtx\n", thread_num);
ret_val = pthread_mutex_lock(&r_mtx);
check_error(ret_val, "mutex_lock r_mtx");
printf("Thread %d - got r_mtx\n", thread_num);
ret_val = pthread_mutex_unlock(&r_mtx);
check_error(ret_val, "mutex_unlock r_mtx");
printf("Thread %d - released r_mtx\n", thread_num);
ret_val = pthread_mutex_unlock(&r_mtx);
check_error(ret_val, "mutex_unlock r_mtx");
printf("Thread %d - released r_mtx\n", thread_num);
/* Try locking the non-recursive lock recursively */
ret_val = pthread_mutex_lock(&n_mtx);
check_error(ret_val, "mutex_lock n_mtx");
printf("Thread %d - got n_mtx\n", thread_num);
ret_val = pthread_mutex_lock(&n_mtx);
check_error(ret_val, "mutex_lock n_mtx");
printf("Thread %d - got n_mtx\n", thread_num);
ret_val = pthread_mutex_unlock(&n_mtx);
check_error(ret_val, "mutex_unlock n_mtx");
printf("Thread %d - released n_mtx\n", thread_num);
Modes of Thread debugging in HP WDB 21