I have a question about mutex lock in function calls
Will scheme prevent my t[1] thread from accessing foo_1 ? Basically I want to understand the hericharcy of mutex locks with the top level API has acquired a lock can another thread access the API underneath ?
mutex M1;
pthread_t t[2];
int foo_1()
{
do some data manupulation //
}
int foo_0()
{
mutex.lock(&M1);
// do some data manupulation//
foo_1();
mutex.free(&M1);
}
void(main)
{
mutex.init(&M1);
pthread_create(&t[i],null,&foo_0,NULL); // create thread that will call foo_0();
pthread_create(&t[2],null,&foo_1,NULL);//
}