Sorry for confusing you.
Above all, my program runs on user space.
Briefly, for my case, I use sem_wait/sem_post
to ensure the synchronization of two threads. But something, I think it is a certain signal, sometimes make sem_wait
return. So I tend to check the return code of sem_wait
to determine if the thread blocked here would go on to step or continue waiting. According to man
, sem_wait returns zero on getting expected resource. Here I need your confirmation on my idea. Say, do my idea will work fine? Or is there better idea for my case?
So far, is my problem clearer?
I will appreciate if you provide any general knowledge related to my case.