Question: Following code contains function called count which is ensuring the consistency of shar Assume that Count function can be called by several of thread and
Following code contains function called count which is ensuring the consistency of shar Assume that Count function can be called by several of thread and doesn't allow cnt bec Write pthreadmutexlock and pthreadmutexunlock functions into critical sections of
Itdefine NITER
pthreadmutext nutex PTHREADMUTEXINITIALIZER;
int cnt ;
void countvoid a
int tmp;
for NITER;
cnt
;
cnt tmp;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
