コンパイル中に、このエラーが発生しました
expected 'union pthread_mutex_t *' but argument is type of 'pthread_mutex_t'
1)'union pthread_mutex_t*'と'pthread_mutex_t'の違いは何ですか?
2)「pthread_mutex_t」を正しい引数にするにはどうすればよいですか?
void buffer_insert(int number)
{
pthread_mutex_t padlock;
pthread_cond_t non_full;
pthread_mutex_init(&padlock, NULL);
pthread_cond_init(&non_full, NULL);
if(available_buffer()){
put_in_buffer(number);
} else {
pthread_mutex_lock(padlock);
pthread_cond_wait(non_full, padlock);
put_in_buffer(number);
pthread_mutex_unlock(padlock);
pthread_cond_signal(non_empty);
}
}