Page 1 of 1
Update function LockMutex and WaitSemaphore
Posted: Fri Aug 16, 2013 6:35 pm
by User_Russian
I propose to add optional parameter to the function LockMutex and WaitSemaphore.
Code: Select all
LockMutex(Mutex [,Timeout])
WaitSemaphore(Semaphore [,Timeout])
The parameter "Timeout" sets the wait object.
If the object is received, function returns #True.
Or #False, if the exit the timeout.
Re: Update function LockMutex and WaitSemaphore
Posted: Fri Aug 16, 2013 7:28 pm
by STARGĂ…TE
Locked is locked,
you want to check, use TryLockMutex(Mutex) or TrySemaphore(Semaphore).
Re: Update function LockMutex and WaitSemaphore
Posted: Fri Aug 16, 2013 7:56 pm
by User_Russian
This option will not work, because in the program, the mutex is locked most of the time and only for a moment, unlock. Therefore, the timeout should be counted at the system level, not the application.
In addition, exit on timeout to avoid a deadlock flows.
Re: Update function LockMutex and WaitSemaphore
Posted: Thu Aug 22, 2013 1:06 am
by RichAlgeni
User_Russian wrote:the mutex is locked most of the time
User_Russian, I find myself wondering under what conditions your mutex would be locked most of the time. It almost seems counter-intuitive.