foobar2000 SDK  2015-08-03
Public Member Functions | Private Member Functions | Private Attributes
mutexScope

#include <win32_misc.h>

Public Member Functions

 mutexScope (HANDLE hMutex_, abort_callback &abort)
 
 ~mutexScope ()
 

Private Member Functions

 PFC_CLASS_NOT_COPYABLE_EX (mutexScope)
 

Private Attributes

HANDLE hMutex
 

Detailed Description

Definition at line 284 of file win32_misc.h.

Constructor & Destructor Documentation

mutexScope::mutexScope ( HANDLE  hMutex_,
abort_callback abort 
)

Definition at line 163 of file win32_misc.cpp.

163  : hMutex(hMutex_) {
164  HANDLE h[2] = {hMutex, abort.get_abort_event()};
165  switch( WaitForMultipleObjects(2, h, FALSE, INFINITE) ) {
166  case WAIT_OBJECT_0:
167  break; // and enter
168  case WAIT_OBJECT_0+1:
169  throw exception_aborted();
170  default:
171  uBugCheck();
172  }
173 }
DWORD WaitForMultipleObjects(DWORD nCount, const HANDLE *lpHandles, BOOL bWaitAll, DWORD dwMilliseconds)
Definition: pp-winapi.h:20
HANDLE hMutex
Definition: win32_misc.h:290
typedef HANDLE(WINAPI *pPowerCreateRequest_t)(__in void *Context)
PFC_NORETURN void SHARED_EXPORT uBugCheck()
mutexScope::~mutexScope ( )

Definition at line 174 of file win32_misc.cpp.

174  {
175  ReleaseMutex(hMutex);
176 }
HANDLE hMutex
Definition: win32_misc.h:290

Member Function Documentation

mutexScope::PFC_CLASS_NOT_COPYABLE_EX ( mutexScope  )
private

Field Documentation

HANDLE mutexScope::hMutex
private

Definition at line 290 of file win32_misc.h.


The documentation for this class was generated from the following files: