qmgr: Don't inline transitionJobState.

This commit is contained in:
Hans Leidekker 2015-06-12 15:07:22 +02:00 committed by Alexandre Julliard
parent 13c3f7ac2b
commit bda14f61fc
2 changed files with 15 additions and 15 deletions

View File

@ -27,6 +27,20 @@
WINE_DEFAULT_DEBUG_CHANNEL(qmgr);
BOOL transitionJobState(BackgroundCopyJobImpl *job, BG_JOB_STATE from, BG_JOB_STATE to)
{
BOOL ret = FALSE;
EnterCriticalSection(&globalMgr.cs);
if (job->state == from)
{
job->state = to;
ret = TRUE;
}
LeaveCriticalSection(&globalMgr.cs);
return ret;
}
struct copy_error
{
IBackgroundCopyError IBackgroundCopyError_iface;

View File

@ -113,6 +113,7 @@ HRESULT EnumBackgroundCopyFilesConstructor(BackgroundCopyJobImpl*, IEnumBackgrou
DWORD WINAPI fileTransfer(void *param) DECLSPEC_HIDDEN;
void processJob(BackgroundCopyJobImpl *job) DECLSPEC_HIDDEN;
BOOL processFile(BackgroundCopyFileImpl *file, BackgroundCopyJobImpl *job) DECLSPEC_HIDDEN;
BOOL transitionJobState(BackgroundCopyJobImpl *job, BG_JOB_STATE from, BG_JOB_STATE to) DECLSPEC_HIDDEN;
/* Little helper functions */
static inline WCHAR *strdupW(const WCHAR *src)
@ -142,19 +143,4 @@ static inline HRESULT return_strval(const WCHAR *str, WCHAR **ret)
return S_OK;
}
static inline BOOL
transitionJobState(BackgroundCopyJobImpl *job, BG_JOB_STATE fromState,
BG_JOB_STATE toState)
{
BOOL rv = FALSE;
EnterCriticalSection(&globalMgr.cs);
if (job->state == fromState)
{
job->state = toState;
rv = TRUE;
}
LeaveCriticalSection(&globalMgr.cs);
return rv;
}
#endif /* __QMGR_H__ */