Hi I am using critical section and I have a question. I thought that if a thread locks a critical section, another thread will wait until the first thread unlocks the critical section. It seems that it does not lock the critical section though. Instead in the critical section structure, recursionCount is incremented and the owning thread changes to the id of the thread that called EnterCriticalSection first. I set it up as follows:
Code:
CRITICAL_SECTION RREQ_VALID_CRITICAL_SECTION; /*locks rreq_valid_Buffer and backPtr_buffer*/

InitializeCriticalSection(&RREQ_VALID_CRITICAL_SECTION);
What is that recursionCount part. Can anybody explain
Anything special that I should have done for it to lock.
Thanks
Amish