EnterCriticalSection() will always provide me with the following error:
(LeaveCriticalSection() incidentally throws the same error - I assume it's related.)
This is all that is required for me to get the error. Adding a long sleep after CriticalObject() or adding keys to obj does not make a difference. I have also tried temporarily disabling my antivirus just incase that operation was getting flagged somehow.
Code: Select all
obj := CriticalObject() ;works
EnterCriticalSection(obj) ;throws error
LeaveCriticalSection(obj) ;also throws its own error
Code: Select all
obj := CriticalObject() ; Create new critical object
Loop 4 ; Create 4 Threads.
AhkThread%A_Index% := AhkThread("obj:=CriticalObject(" (&obj) ")`nLoop`nobj[" A_Index "]:= A_Index")
Loop ; Show current content of object.
ToolTip % obj.1 "`n" obj.2 "`n" obj.3 "`n" obj.4
Esc::ExitApp
- Win10 Pro Build 19045 x64, running as admin
- freshly downloaded latest version of AHK_H v1 x64
- ESET Smart Security antivirus