Hi, I am facing sync related issue in multi threading. I have an shared library which applications use to build there applications. From the library I have created a thread which listen to the request coming and process it its is real time thread.From the library i have invoked an API which is sync in nature which will wait for response to come from other module. This API has some dependency from other module from which response should come after the 1st response.But sometimes 2nd response comes 1st so the API get failed and sometimes it works fine. mutex locks arpit already applied. Can anyone tell me what should be the approach to fix the issue ?? I hope my question is clear.
EDIT: its on c + unix