[3/6] qmgr: Add a mutex to BackgroundCopyJob.

Robert Shearman rob at codeweavers.com
Fri Mar 7 03:02:19 CST 2008


Dan Hipschman wrote:
> Pretty much the same as yesterday but I changed to using mutexes instead
> of critical sections since I need to wait on two at once (one for the
> job and the other for the file when updating progress).
>   

I'm not sure this is a correct reason for mutexes instead of critical 
sections. Either way, you need to have a strict ordering so that you 
don't deadlock and critical sections use mutexes underneath. Unless 
you're going to be using a named mutex to synchronise across processes 
or you're going to have threads quit whilst holding the mutex, then the 
only difference will be that the code is slower when using mutexes 
because of the necessary server call, which more often than not can be 
avoided with critical sections.

-- 
Rob Shearman




More information about the wine-devel mailing list