void *consumer()
{
int i, v;
for(i=0;i<100;i++)
{
pthread_mutex_lock(®ion_mutex);
v=get_buffer();
pthread_mutex_unlock(®ion_mutex);
printf("got %d ",v");
}
}
----------------------------------------------------------------------------- Errors I get:
-------------
When I compile this program, I get the following errors:
In function `main':
MutexExample.c:(.text+0x1f): undefined reference to `pthread_create'
MutexExample.c:(.text+0x3a): undefined reference to `pthread_create'
MutexExample.c:(.text+0x4b): undefined reference to `pthread_join'
/tmp/cc8pA8kt.o: In function `producer':
MutexExample.c:(.text+0x93): undefined reference to `put_buffer'
collect2: ld returned 1 exit status