Unsolved QMutexLocker - locking question
-
Hey
So I have a
QMutexLocker l(&mLock);
When this function gets called and mLock is already locked by another thread. What happens?
- The program stops & try-lock/wait forever until he can access the mutex to lock it?
- The program stops and does nothing.
I'm trying to debug app locks :- )
TIA!
-
@Dariusz
I assume it does as perQMutextLocker::lock()
, i.e. block and wait. -
So if its already locked, then it waits? Will it try again locking or its just in waiting mode?
-
@Dariusz
I believe it will block/wait and then lock and continue as & when the mutex gets unlocked. But you should test. -
@Dariusz said in QMutexLocker - locking question:
So if its already locked, then it waits?
This is exactly what a mutex is build for...