and create a mutex for each thread, it doesnt matter the order, just that each thread has its own mutex
You don't create mutex per thread. To write to a variable for example you need to do something like :
GetMutex()
Write()
ReleaseMutex()
Igor🇺🇦
Andrew
Alex
YVEF
Vlad
ɴꙩᴍᴀᴅ
Nuri
Hasan Emre
محمود
Harsh
Mahsun
Sandro
Pavel
VAIBHAV
....
olli