No, access violation as i want.
As you suggest I change the code, now is that:
It works fine.Code:void WINAPI fxCriticalSection(void) { while (TryEnterCriticalSection(&CriticalSection_Cadena) == 0) { Sleep(Aleatorio(0,10)); nHilosEsperan++; } char c = Aleatorio(97, 122); // del 97 al 122 las letras int nPos = Aleatorio(0, (MAXCADENA-1)); sCadena[nPos] = c; nNumero = c; LeaveCriticalSection(&CriticalSection_Cadena); }
Thank you for your suggest.
Best regards, Toño.




Reply With Quote