Just want a little clarity on the this.
Imagine I use the windows api of EnterCriticalSection. I call all of them with EnterCriticalSection(&criticalsection);
This is the thread function that is multi threaded
void thread (){
//enter critical section (part 1)
data
//leave critical section
///more data 1
//entercritical section (part 2)
//more data 2
//leave critical section
}
Once a thread enters the critical (part 1), other threads cannot enter that section regardless of whether more data 1 actually has any shared data or not right? Also during that time other threads also cannot enter part 2 of the critical section either.