Windows Win32Sincronizaçãokernel32.dll
TryEnterCriticalSection
Tenta adquirir uma seção crítica sem bloquear, retornando imediatamente se já estiver ocupada.
Descrição
Análogo a `pthread_mutex_trylock(3)`.
Header:
synchapi.hDLL: kernel32.dllAssinatura
BOOL TryEnterCriticalSection(LPCRITICAL_SECTION lpCriticalSection);Parâmetros
| Parâmetro | Tipo | Descrição |
|---|---|---|
| lpCriticalSection | LPCRITICAL_SECTION | Seção crítica a tentar adquirir. |
Valor de retorno
Diferente de zero se adquirida; 0 se já estava ocupada por outra thread.
Códigos de erro (GetLastError)
Nenhum código de erro específico documentado para esta chamada.