FreeRDP
include/winpr/synch.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <winpr/platform.h>
#include <winpr/winpr.h>
#include <winpr/wtypes.h>
#include <winpr/error.h>
#include <winpr/handle.h>
#include <winpr/nt.h>

Data Structures

struct  RTL_CRITICAL_SECTION
 
struct  REASON_CONTEXT
 
struct  RTL_RUN_ONCE
 
struct  RTL_BARRIER
 

Macros

#define CREATE_MUTEX_INITIAL_OWNER   0x00000001
 
#define CreateMutex   CreateMutexA
 
#define CreateMutexEx   CreateMutexExA
 
#define OpenMutex   OpenMutexA
 
#define CreateSemaphore   CreateSemaphoreA
 
#define OpenSemaphore   OpenSemaphoreA
 
#define CREATE_EVENT_MANUAL_RESET   0x00000001
 
#define CREATE_EVENT_INITIAL_SET   0x00000002
 
#define CreateEvent   CreateEventA
 
#define CreateEventEx   CreateEventExA
 
#define OpenEvent   OpenEventA
 
#define INFINITE   0xFFFFFFFFUL
 
#define WAIT_OBJECT_0   0x00000000UL
 
#define WAIT_ABANDONED   0x00000080UL
 
#define WAIT_IO_COMPLETION   0x000000C0UL
 
#define WAIT_TIMEOUT   0x00000102UL
 
#define WAIT_FAILED   0xFFFFFFFFUL
 
#define MAXIMUM_WAIT_OBJECTS   64
 
#define CREATE_WAITABLE_TIMER_MANUAL_RESET   0x00000001
 
#define CreateWaitableTimer   CreateWaitableTimerA
 
#define CreateWaitableTimerEx   CreateWaitableTimerExA
 
#define OpenWaitableTimer   OpenWaitableTimerA
 
#define WT_EXECUTEDEFAULT   0x00000000
 
#define WT_EXECUTEINIOTHREAD   0x00000001
 
#define WT_EXECUTEINUITHREAD   0x00000002
 
#define WT_EXECUTEINWAITTHREAD   0x00000004
 
#define WT_EXECUTEONLYONCE   0x00000008
 
#define WT_EXECUTELONGFUNCTION   0x00000010
 
#define WT_EXECUTEINTIMERTHREAD   0x00000020
 
#define WT_EXECUTEINPERSISTENTIOTHREAD   0x00000040
 
#define WT_EXECUTEINPERSISTENTTHREAD   0x00000080
 
#define WT_TRANSFER_IMPERSONATION   0x00000100
 
#define _RTL_RUN_ONCE_DEF
 
#define RTL_RUN_ONCE_INIT
 
#define RTL_RUN_ONCE_CHECK_ONLY   0x00000001
 
#define RTL_RUN_ONCE_ASYNC   0x00000002
 
#define RTL_RUN_ONCE_INIT_FAILED   0x00000004
 
#define RTL_RUN_ONCE_CTX_RESERVED_BITS   2
 
#define INIT_ONCE_STATIC_INIT   RTL_RUN_ONCE_INIT
 
#define InitOnceBeginInitialize   winpr_InitOnceBeginInitialize
 
#define InitOnceComplete   winpr_InitOnceComplete
 
#define InitOnceExecuteOnce   winpr_InitOnceExecuteOnce
 
#define InitOnceInitialize   winpr_InitOnceInitialize
 
#define WINPR_SYNCHRONIZATION_BARRIER   1
 
#define SYNCHRONIZATION_BARRIER_FLAGS_SPIN_ONLY   0x01
 
#define SYNCHRONIZATION_BARRIER_FLAGS_BLOCK_ONLY   0x02
 
#define SYNCHRONIZATION_BARRIER_FLAGS_NO_DELETE   0x04
 
#define InitializeSynchronizationBarrier   winpr_InitializeSynchronizationBarrier
 
#define EnterSynchronizationBarrier   winpr_EnterSynchronizationBarrier
 
#define DeleteSynchronizationBarrier   winpr_DeleteSynchronizationBarrier
 
#define CreateFileDescriptorEvent   CreateFileDescriptorEventA
 

Typedefs

typedef PVOID RTL_CONDITION_VARIABLE
 
typedef RTL_CONDITION_VARIABLE CONDITION_VARIABLE
 
typedef RTL_CONDITION_VARIABLEPCONDITION_VARIABLE
 
typedef struct RTL_CRITICAL_SECTIONPRTL_CRITICAL_SECTION
 
typedef RTL_CRITICAL_SECTION CRITICAL_SECTION
 
typedef PRTL_CRITICAL_SECTION PCRITICAL_SECTION
 
typedef PRTL_CRITICAL_SECTION LPCRITICAL_SECTION
 
typedef struct REASON_CONTEXTPREASON_CONTEXT
 
typedef VOID(* PTIMERAPCROUTINE) (LPVOID lpArgToCompletionRoutine, DWORD dwTimerLowValue, DWORD dwTimerHighValue)
 
typedef VOID(* WAITORTIMERCALLBACK) (PVOID lpParameter, BOOLEAN TimerOrWaitFired)
 
typedef struct RTL_RUN_ONCEPRTL_RUN_ONCE
 
typedef ULONG CALLBACK RTL_RUN_ONCE_INIT_FN(PRTL_RUN_ONCE RunOnce, PVOID Parameter, PVOID *Context)
 
typedef RTL_RUN_ONCE_INIT_FNPRTL_RUN_ONCE_INIT_FN
 
typedef RTL_RUN_ONCE INIT_ONCE
 
typedef PRTL_RUN_ONCE PINIT_ONCE
 
typedef PRTL_RUN_ONCE LPINIT_ONCE
 
typedef BOOL(CALLBACK * PINIT_ONCE_FN) (PINIT_ONCE InitOnce, PVOID Parameter, PVOID *Context)
 
typedef struct RTL_BARRIERPRTL_BARRIER
 
typedef RTL_BARRIER SYNCHRONIZATION_BARRIER
 
typedef PRTL_BARRIER PSYNCHRONIZATION_BARRIER
 
typedef PRTL_BARRIER LPSYNCHRONIZATION_BARRIER
 

Functions

WINPR_API HANDLE CreateMutexA (LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner, LPCSTR lpName)
 
WINPR_API HANDLE CreateMutexW (LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner, LPCWSTR lpName)
 
WINPR_API HANDLE CreateMutexExA (LPSECURITY_ATTRIBUTES lpMutexAttributes, LPCSTR lpName, DWORD dwFlags, DWORD dwDesiredAccess)
 
WINPR_API HANDLE CreateMutexExW (LPSECURITY_ATTRIBUTES lpMutexAttributes, LPCWSTR lpName, DWORD dwFlags, DWORD dwDesiredAccess)
 
WINPR_API HANDLE OpenMutexA (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName)
 
WINPR_API HANDLE OpenMutexW (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName)
 
WINPR_API BOOL ReleaseMutex (HANDLE hMutex)
 
WINPR_API HANDLE CreateSemaphoreA (LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, LONG lInitialCount, LONG lMaximumCount, LPCSTR lpName)
 
WINPR_API HANDLE CreateSemaphoreW (LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, LONG lInitialCount, LONG lMaximumCount, LPCWSTR lpName)
 
WINPR_API HANDLE OpenSemaphoreA (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName)
 
WINPR_API HANDLE OpenSemaphoreW (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName)
 
WINPR_API BOOL ReleaseSemaphore (HANDLE hSemaphore, LONG lReleaseCount, LPLONG lpPreviousCount)
 
WINPR_API HANDLE CreateEventA (LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, BOOL bInitialState, LPCSTR lpName)
 
WINPR_API HANDLE CreateEventW (LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, BOOL bInitialState, LPCWSTR lpName)
 
WINPR_API HANDLE CreateEventExA (LPSECURITY_ATTRIBUTES lpEventAttributes, LPCSTR lpName, DWORD dwFlags, DWORD dwDesiredAccess)
 
WINPR_API HANDLE CreateEventExW (LPSECURITY_ATTRIBUTES lpEventAttributes, LPCWSTR lpName, DWORD dwFlags, DWORD dwDesiredAccess)
 
WINPR_API HANDLE OpenEventA (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName)
 
WINPR_API HANDLE OpenEventW (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName)
 
WINPR_API BOOL SetEvent (HANDLE hEvent)
 
WINPR_API BOOL ResetEvent (HANDLE hEvent)
 
WINPR_API VOID InitializeCriticalSection (LPCRITICAL_SECTION lpCriticalSection)
 
WINPR_API BOOL InitializeCriticalSectionEx (LPCRITICAL_SECTION lpCriticalSection, DWORD dwSpinCount, DWORD Flags)
 
WINPR_API BOOL InitializeCriticalSectionAndSpinCount (LPCRITICAL_SECTION lpCriticalSection, DWORD dwSpinCount)
 
WINPR_API DWORD SetCriticalSectionSpinCount (LPCRITICAL_SECTION lpCriticalSection, DWORD dwSpinCount)
 
WINPR_API VOID EnterCriticalSection (LPCRITICAL_SECTION lpCriticalSection)
 
WINPR_API BOOL TryEnterCriticalSection (LPCRITICAL_SECTION lpCriticalSection)
 
WINPR_API VOID LeaveCriticalSection (LPCRITICAL_SECTION lpCriticalSection)
 
WINPR_API VOID DeleteCriticalSection (LPCRITICAL_SECTION lpCriticalSection)
 
WINPR_API VOID Sleep (DWORD dwMilliseconds)
 
WINPR_API DWORD SleepEx (DWORD dwMilliseconds, BOOL bAlertable)
 
WINPR_API VOID WakeByAddressAll (PVOID Address)
 
WINPR_API VOID WakeByAddressSingle (PVOID Address)
 
WINPR_API BOOL WaitOnAddress (VOID volatile *Address, PVOID CompareAddress, SIZE_T AddressSize, DWORD dwMilliseconds)
 
WINPR_API DWORD WaitForSingleObject (HANDLE hHandle, DWORD dwMilliseconds)
 
WINPR_API DWORD WaitForSingleObjectEx (HANDLE hHandle, DWORD dwMilliseconds, BOOL bAlertable)
 
WINPR_API DWORD WaitForMultipleObjects (DWORD nCount, const HANDLE *lpHandles, BOOL bWaitAll, DWORD dwMilliseconds)
 
WINPR_API DWORD WaitForMultipleObjectsEx (DWORD nCount, const HANDLE *lpHandles, BOOL bWaitAll, DWORD dwMilliseconds, BOOL bAlertable)
 
WINPR_API DWORD SignalObjectAndWait (HANDLE hObjectToSignal, HANDLE hObjectToWaitOn, DWORD dwMilliseconds, BOOL bAlertable)
 
WINPR_API HANDLE CreateWaitableTimerA (LPSECURITY_ATTRIBUTES lpTimerAttributes, BOOL bManualReset, LPCSTR lpTimerName)
 
WINPR_API HANDLE CreateWaitableTimerW (LPSECURITY_ATTRIBUTES lpTimerAttributes, BOOL bManualReset, LPCWSTR lpTimerName)
 
WINPR_API HANDLE CreateWaitableTimerExA (LPSECURITY_ATTRIBUTES lpTimerAttributes, LPCSTR lpTimerName, DWORD dwFlags, DWORD dwDesiredAccess)
 
WINPR_API HANDLE CreateWaitableTimerExW (LPSECURITY_ATTRIBUTES lpTimerAttributes, LPCWSTR lpTimerName, DWORD dwFlags, DWORD dwDesiredAccess)
 
WINPR_API BOOL SetWaitableTimer (HANDLE hTimer, const LARGE_INTEGER *lpDueTime, LONG lPeriod, PTIMERAPCROUTINE pfnCompletionRoutine, LPVOID lpArgToCompletionRoutine, BOOL fResume)
 
WINPR_API BOOL SetWaitableTimerEx (HANDLE hTimer, const LARGE_INTEGER *lpDueTime, LONG lPeriod, PTIMERAPCROUTINE pfnCompletionRoutine, LPVOID lpArgToCompletionRoutine, PREASON_CONTEXT WakeContext, ULONG TolerableDelay)
 
WINPR_API HANDLE OpenWaitableTimerA (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpTimerName)
 
WINPR_API HANDLE OpenWaitableTimerW (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpTimerName)
 
WINPR_API BOOL CancelWaitableTimer (HANDLE hTimer)
 
WINPR_API int GetTimerFileDescriptor (HANDLE hEvent)
 
WINPR_API HANDLE CreateTimerQueue (void)
 
WINPR_API BOOL DeleteTimerQueue (HANDLE TimerQueue)
 
WINPR_API BOOL DeleteTimerQueueEx (HANDLE TimerQueue, HANDLE CompletionEvent)
 
WINPR_API BOOL CreateTimerQueueTimer (PHANDLE phNewTimer, HANDLE TimerQueue, WAITORTIMERCALLBACK Callback, PVOID Parameter, DWORD DueTime, DWORD Period, ULONG Flags)
 
WINPR_API BOOL ChangeTimerQueueTimer (HANDLE TimerQueue, HANDLE Timer, ULONG DueTime, ULONG Period)
 
WINPR_API BOOL DeleteTimerQueueTimer (HANDLE TimerQueue, HANDLE Timer, HANDLE CompletionEvent)
 
WINPR_API BOOL winpr_InitOnceBeginInitialize (LPINIT_ONCE lpInitOnce, DWORD dwFlags, PBOOL fPending, LPVOID *lpContext)
 
WINPR_API BOOL winpr_InitOnceComplete (LPINIT_ONCE lpInitOnce, DWORD dwFlags, LPVOID lpContext)
 
WINPR_API BOOL winpr_InitOnceExecuteOnce (PINIT_ONCE InitOnce, PINIT_ONCE_FN InitFn, PVOID Parameter, LPVOID *Context)
 
WINPR_API VOID winpr_InitOnceInitialize (PINIT_ONCE InitOnce)
 
WINPR_API BOOL WINAPI winpr_InitializeSynchronizationBarrier (LPSYNCHRONIZATION_BARRIER lpBarrier, LONG lTotalThreads, LONG lSpinCount)
 
WINPR_API BOOL WINAPI winpr_EnterSynchronizationBarrier (LPSYNCHRONIZATION_BARRIER lpBarrier, DWORD dwFlags)
 
WINPR_API BOOL WINAPI winpr_DeleteSynchronizationBarrier (LPSYNCHRONIZATION_BARRIER lpBarrier)
 
WINPR_API VOID USleep (DWORD dwMicroseconds)
 
WINPR_API HANDLE CreateFileDescriptorEventW (LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, BOOL bInitialState, int FileDescriptor, ULONG mode)
 
WINPR_API HANDLE CreateFileDescriptorEventA (LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, BOOL bInitialState, int FileDescriptor, ULONG mode)
 
WINPR_API HANDLE CreateWaitObjectEvent (LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, BOOL bInitialState, void *pObject)
 
WINPR_API int GetEventFileDescriptor (HANDLE hEvent)
 
WINPR_API int SetEventFileDescriptor (HANDLE hEvent, int FileDescriptor, ULONG mode)
 
WINPR_API void * GetEventWaitObject (HANDLE hEvent)
 

Macro Definition Documentation

◆ _RTL_RUN_ONCE_DEF

#define _RTL_RUN_ONCE_DEF

◆ CREATE_EVENT_INITIAL_SET

#define CREATE_EVENT_INITIAL_SET   0x00000002

◆ CREATE_EVENT_MANUAL_RESET

#define CREATE_EVENT_MANUAL_RESET   0x00000001

◆ CREATE_MUTEX_INITIAL_OWNER

#define CREATE_MUTEX_INITIAL_OWNER   0x00000001

WinPR: Windows Portable Runtime Synchronization Functions

Copyright 2012 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..nosp@m.com Copyright 2014 Thincast Technologies GmbH Copyright 2014 Norbert Federa norbe.nosp@m.rt.f.nosp@m.edera.nosp@m.@thi.nosp@m.ncast.nosp@m..com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

◆ CREATE_WAITABLE_TIMER_MANUAL_RESET

#define CREATE_WAITABLE_TIMER_MANUAL_RESET   0x00000001

◆ CreateEvent

#define CreateEvent   CreateEventA

◆ CreateEventEx

#define CreateEventEx   CreateEventExA

◆ CreateFileDescriptorEvent

#define CreateFileDescriptorEvent   CreateFileDescriptorEventA

◆ CreateMutex

#define CreateMutex   CreateMutexA

◆ CreateMutexEx

#define CreateMutexEx   CreateMutexExA

◆ CreateSemaphore

#define CreateSemaphore   CreateSemaphoreA

◆ CreateWaitableTimer

#define CreateWaitableTimer   CreateWaitableTimerA

◆ CreateWaitableTimerEx

#define CreateWaitableTimerEx   CreateWaitableTimerExA

◆ DeleteSynchronizationBarrier

#define DeleteSynchronizationBarrier   winpr_DeleteSynchronizationBarrier

◆ EnterSynchronizationBarrier

#define EnterSynchronizationBarrier   winpr_EnterSynchronizationBarrier

◆ INFINITE

#define INFINITE   0xFFFFFFFFUL

◆ INIT_ONCE_STATIC_INIT

#define INIT_ONCE_STATIC_INIT   RTL_RUN_ONCE_INIT

◆ InitializeSynchronizationBarrier

#define InitializeSynchronizationBarrier   winpr_InitializeSynchronizationBarrier

◆ InitOnceBeginInitialize

#define InitOnceBeginInitialize   winpr_InitOnceBeginInitialize

◆ InitOnceComplete

#define InitOnceComplete   winpr_InitOnceComplete

◆ InitOnceExecuteOnce

#define InitOnceExecuteOnce   winpr_InitOnceExecuteOnce

◆ InitOnceInitialize

#define InitOnceInitialize   winpr_InitOnceInitialize

◆ MAXIMUM_WAIT_OBJECTS

#define MAXIMUM_WAIT_OBJECTS   64

◆ OpenEvent

#define OpenEvent   OpenEventA

◆ OpenMutex

#define OpenMutex   OpenMutexA

◆ OpenSemaphore

#define OpenSemaphore   OpenSemaphoreA

◆ OpenWaitableTimer

#define OpenWaitableTimer   OpenWaitableTimerA

◆ RTL_RUN_ONCE_ASYNC

#define RTL_RUN_ONCE_ASYNC   0x00000002

◆ RTL_RUN_ONCE_CHECK_ONLY

#define RTL_RUN_ONCE_CHECK_ONLY   0x00000001

◆ RTL_RUN_ONCE_CTX_RESERVED_BITS

#define RTL_RUN_ONCE_CTX_RESERVED_BITS   2

◆ RTL_RUN_ONCE_INIT

#define RTL_RUN_ONCE_INIT
Value:
{ \
0 \
}

◆ RTL_RUN_ONCE_INIT_FAILED

#define RTL_RUN_ONCE_INIT_FAILED   0x00000004

◆ SYNCHRONIZATION_BARRIER_FLAGS_BLOCK_ONLY

#define SYNCHRONIZATION_BARRIER_FLAGS_BLOCK_ONLY   0x02

◆ SYNCHRONIZATION_BARRIER_FLAGS_NO_DELETE

#define SYNCHRONIZATION_BARRIER_FLAGS_NO_DELETE   0x04

◆ SYNCHRONIZATION_BARRIER_FLAGS_SPIN_ONLY

#define SYNCHRONIZATION_BARRIER_FLAGS_SPIN_ONLY   0x01

◆ WAIT_ABANDONED

#define WAIT_ABANDONED   0x00000080UL

◆ WAIT_FAILED

#define WAIT_FAILED   0xFFFFFFFFUL

◆ WAIT_IO_COMPLETION

#define WAIT_IO_COMPLETION   0x000000C0UL

◆ WAIT_OBJECT_0

#define WAIT_OBJECT_0   0x00000000UL

◆ WAIT_TIMEOUT

#define WAIT_TIMEOUT   0x00000102UL

◆ WINPR_SYNCHRONIZATION_BARRIER

#define WINPR_SYNCHRONIZATION_BARRIER   1

◆ WT_EXECUTEDEFAULT

#define WT_EXECUTEDEFAULT   0x00000000

Timer-Queue Timer

◆ WT_EXECUTEINIOTHREAD

#define WT_EXECUTEINIOTHREAD   0x00000001

◆ WT_EXECUTEINPERSISTENTIOTHREAD

#define WT_EXECUTEINPERSISTENTIOTHREAD   0x00000040

◆ WT_EXECUTEINPERSISTENTTHREAD

#define WT_EXECUTEINPERSISTENTTHREAD   0x00000080

◆ WT_EXECUTEINTIMERTHREAD

#define WT_EXECUTEINTIMERTHREAD   0x00000020

◆ WT_EXECUTEINUITHREAD

#define WT_EXECUTEINUITHREAD   0x00000002

◆ WT_EXECUTEINWAITTHREAD

#define WT_EXECUTEINWAITTHREAD   0x00000004

◆ WT_EXECUTELONGFUNCTION

#define WT_EXECUTELONGFUNCTION   0x00000010

◆ WT_EXECUTEONLYONCE

#define WT_EXECUTEONLYONCE   0x00000008

◆ WT_TRANSFER_IMPERSONATION

#define WT_TRANSFER_IMPERSONATION   0x00000100

Typedef Documentation

◆ CONDITION_VARIABLE

◆ CRITICAL_SECTION

◆ INIT_ONCE

◆ LPCRITICAL_SECTION

◆ LPINIT_ONCE

◆ LPSYNCHRONIZATION_BARRIER

◆ PCONDITION_VARIABLE

◆ PCRITICAL_SECTION

◆ PINIT_ONCE

◆ PINIT_ONCE_FN

typedef BOOL(CALLBACK* PINIT_ONCE_FN) (PINIT_ONCE InitOnce, PVOID Parameter, PVOID *Context)

◆ PREASON_CONTEXT

typedef struct REASON_CONTEXT * PREASON_CONTEXT

◆ PRTL_BARRIER

typedef struct RTL_BARRIER * PRTL_BARRIER

◆ PRTL_CRITICAL_SECTION

◆ PRTL_RUN_ONCE

typedef struct RTL_RUN_ONCE * PRTL_RUN_ONCE

◆ PRTL_RUN_ONCE_INIT_FN

◆ PSYNCHRONIZATION_BARRIER

◆ PTIMERAPCROUTINE

typedef VOID(* PTIMERAPCROUTINE) (LPVOID lpArgToCompletionRoutine, DWORD dwTimerLowValue, DWORD dwTimerHighValue)

◆ RTL_CONDITION_VARIABLE

typedef PVOID RTL_CONDITION_VARIABLE

◆ RTL_RUN_ONCE_INIT_FN

typedef ULONG CALLBACK RTL_RUN_ONCE_INIT_FN(PRTL_RUN_ONCE RunOnce, PVOID Parameter, PVOID *Context)

◆ SYNCHRONIZATION_BARRIER

◆ WAITORTIMERCALLBACK

typedef VOID(* WAITORTIMERCALLBACK) (PVOID lpParameter, BOOLEAN TimerOrWaitFired)

Function Documentation

◆ CancelWaitableTimer()

WINPR_API BOOL CancelWaitableTimer ( HANDLE  hTimer)
Here is the call graph for this function:

◆ ChangeTimerQueueTimer()

WINPR_API BOOL ChangeTimerQueueTimer ( HANDLE  TimerQueue,
HANDLE  Timer,
ULONG  DueTime,
ULONG  Period 
)
Here is the call graph for this function:

◆ CreateEventA()

WINPR_API HANDLE CreateEventA ( LPSECURITY_ATTRIBUTES  lpEventAttributes,
BOOL  bManualReset,
BOOL  bInitialState,
LPCSTR  lpName 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateEventExA()

WINPR_API HANDLE CreateEventExA ( LPSECURITY_ATTRIBUTES  lpEventAttributes,
LPCSTR  lpName,
DWORD  dwFlags,
DWORD  dwDesiredAccess 
)
Here is the call graph for this function:

◆ CreateEventExW()

WINPR_API HANDLE CreateEventExW ( LPSECURITY_ATTRIBUTES  lpEventAttributes,
LPCWSTR  lpName,
DWORD  dwFlags,
DWORD  dwDesiredAccess 
)
Here is the call graph for this function:

◆ CreateEventW()

WINPR_API HANDLE CreateEventW ( LPSECURITY_ATTRIBUTES  lpEventAttributes,
BOOL  bManualReset,
BOOL  bInitialState,
LPCWSTR  lpName 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateFileDescriptorEventA()

WINPR_API HANDLE CreateFileDescriptorEventA ( LPSECURITY_ATTRIBUTES  lpEventAttributes,
BOOL  bManualReset,
BOOL  bInitialState,
int  FileDescriptor,
ULONG  mode 
)
Here is the call graph for this function:

◆ CreateFileDescriptorEventW()

WINPR_API HANDLE CreateFileDescriptorEventW ( LPSECURITY_ATTRIBUTES  lpEventAttributes,
BOOL  bManualReset,
BOOL  bInitialState,
int  FileDescriptor,
ULONG  mode 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateMutexA()

WINPR_API HANDLE CreateMutexA ( LPSECURITY_ATTRIBUTES  lpMutexAttributes,
BOOL  bInitialOwner,
LPCSTR  lpName 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateMutexExA()

WINPR_API HANDLE CreateMutexExA ( LPSECURITY_ATTRIBUTES  lpMutexAttributes,
LPCSTR  lpName,
DWORD  dwFlags,
DWORD  dwDesiredAccess 
)
Here is the call graph for this function:

◆ CreateMutexExW()

WINPR_API HANDLE CreateMutexExW ( LPSECURITY_ATTRIBUTES  lpMutexAttributes,
LPCWSTR  lpName,
DWORD  dwFlags,
DWORD  dwDesiredAccess 
)
Here is the call graph for this function:

◆ CreateMutexW()

WINPR_API HANDLE CreateMutexW ( LPSECURITY_ATTRIBUTES  lpMutexAttributes,
BOOL  bInitialOwner,
LPCWSTR  lpName 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateSemaphoreA()

WINPR_API HANDLE CreateSemaphoreA ( LPSECURITY_ATTRIBUTES  lpSemaphoreAttributes,
LONG  lInitialCount,
LONG  lMaximumCount,
LPCSTR  lpName 
)
Here is the call graph for this function:

◆ CreateSemaphoreW()

WINPR_API HANDLE CreateSemaphoreW ( LPSECURITY_ATTRIBUTES  lpSemaphoreAttributes,
LONG  lInitialCount,
LONG  lMaximumCount,
LPCWSTR  lpName 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateTimerQueue()

WINPR_API HANDLE CreateTimerQueue ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateTimerQueueTimer()

WINPR_API BOOL CreateTimerQueueTimer ( PHANDLE  phNewTimer,
HANDLE  TimerQueue,
WAITORTIMERCALLBACK  Callback,
PVOID  Parameter,
DWORD  DueTime,
DWORD  Period,
ULONG  Flags 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateWaitableTimerA()

WINPR_API HANDLE CreateWaitableTimerA ( LPSECURITY_ATTRIBUTES  lpTimerAttributes,
BOOL  bManualReset,
LPCSTR  lpTimerName 
)

Waitable Timer

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateWaitableTimerExA()

WINPR_API HANDLE CreateWaitableTimerExA ( LPSECURITY_ATTRIBUTES  lpTimerAttributes,
LPCSTR  lpTimerName,
DWORD  dwFlags,
DWORD  dwDesiredAccess 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateWaitableTimerExW()

WINPR_API HANDLE CreateWaitableTimerExW ( LPSECURITY_ATTRIBUTES  lpTimerAttributes,
LPCWSTR  lpTimerName,
DWORD  dwFlags,
DWORD  dwDesiredAccess 
)
Here is the call graph for this function:

◆ CreateWaitableTimerW()

WINPR_API HANDLE CreateWaitableTimerW ( LPSECURITY_ATTRIBUTES  lpTimerAttributes,
BOOL  bManualReset,
LPCWSTR  lpTimerName 
)
Here is the call graph for this function:

◆ CreateWaitObjectEvent()

WINPR_API HANDLE CreateWaitObjectEvent ( LPSECURITY_ATTRIBUTES  lpEventAttributes,
BOOL  bManualReset,
BOOL  bInitialState,
void *  pObject 
)

Returns an event based on the handle returned by GetEventWaitObject()

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DeleteCriticalSection()

WINPR_API VOID DeleteCriticalSection ( LPCRITICAL_SECTION  lpCriticalSection)
Here is the caller graph for this function:

◆ DeleteTimerQueue()

WINPR_API BOOL DeleteTimerQueue ( HANDLE  TimerQueue)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DeleteTimerQueueEx()

WINPR_API BOOL DeleteTimerQueueEx ( HANDLE  TimerQueue,
HANDLE  CompletionEvent 
)

Quote from MSDN regarding CompletionEvent: If this parameter is INVALID_HANDLE_VALUE, the function waits for all callback functions to complete before returning. If this parameter is NULL, the function marks the timer for deletion and returns immediately.

Note: The current WinPR implementation implicitly waits for any callback functions to complete (see pthread_join above)

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DeleteTimerQueueTimer()

WINPR_API BOOL DeleteTimerQueueTimer ( HANDLE  TimerQueue,
HANDLE  Timer,
HANDLE  CompletionEvent 
)

Quote from MSDN regarding CompletionEvent: If this parameter is INVALID_HANDLE_VALUE, the function waits for all callback functions to complete before returning. If this parameter is NULL, the function marks the timer for deletion and returns immediately.

Note: The current WinPR implementation implicitly waits for any callback functions to complete (see cond_mutex usage)

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EnterCriticalSection()

WINPR_API VOID EnterCriticalSection ( LPCRITICAL_SECTION  lpCriticalSection)

On some operating systems sched_yield is a stub. usleep should at least trigger a context switch if any thread is waiting. A ThreadYield() would be nice in winpr ...

Here is the call graph for this function:

◆ GetEventFileDescriptor()

WINPR_API int GetEventFileDescriptor ( HANDLE  hEvent)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetEventWaitObject()

WINPR_API void* GetEventWaitObject ( HANDLE  hEvent)

Returns platform-specific wait object as a void pointer

On Windows, the returned object is the same as the hEvent argument and is an event HANDLE usable in WaitForMultipleObjects

On other platforms, the returned object can be cast to an int to obtain a file descriptor usable in select()

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetTimerFileDescriptor()

WINPR_API int GetTimerFileDescriptor ( HANDLE  hEvent)
Here is the call graph for this function:

◆ InitializeCriticalSection()

WINPR_API VOID InitializeCriticalSection ( LPCRITICAL_SECTION  lpCriticalSection)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitializeCriticalSectionAndSpinCount()

WINPR_API BOOL InitializeCriticalSectionAndSpinCount ( LPCRITICAL_SECTION  lpCriticalSection,
DWORD  dwSpinCount 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitializeCriticalSectionEx()

WINPR_API BOOL InitializeCriticalSectionEx ( LPCRITICAL_SECTION  lpCriticalSection,
DWORD  dwSpinCount,
DWORD  Flags 
)

See http://msdn.microsoft.com/en-us/library/ff541979(v=vs.85).aspx

  • The LockCount field indicates the number of times that any thread has called the EnterCriticalSection routine for this critical section, minus one. This field starts at -1 for an unlocked critical section. Each call of EnterCriticalSection increments this value; each call of LeaveCriticalSection decrements it.
  • The RecursionCount field indicates the number of times that the owning thread has called EnterCriticalSection for this critical section.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LeaveCriticalSection()

WINPR_API VOID LeaveCriticalSection ( LPCRITICAL_SECTION  lpCriticalSection)
Here is the call graph for this function:

◆ OpenEventA()

WINPR_API HANDLE OpenEventA ( DWORD  dwDesiredAccess,
BOOL  bInheritHandle,
LPCSTR  lpName 
)

◆ OpenEventW()

WINPR_API HANDLE OpenEventW ( DWORD  dwDesiredAccess,
BOOL  bInheritHandle,
LPCWSTR  lpName 
)

◆ OpenMutexA()

WINPR_API HANDLE OpenMutexA ( DWORD  dwDesiredAccess,
BOOL  bInheritHandle,
LPCSTR  lpName 
)

◆ OpenMutexW()

WINPR_API HANDLE OpenMutexW ( DWORD  dwDesiredAccess,
BOOL  bInheritHandle,
LPCWSTR  lpName 
)

◆ OpenSemaphoreA()

WINPR_API HANDLE OpenSemaphoreA ( DWORD  dwDesiredAccess,
BOOL  bInheritHandle,
LPCSTR  lpName 
)

◆ OpenSemaphoreW()

WINPR_API HANDLE OpenSemaphoreW ( DWORD  dwDesiredAccess,
BOOL  bInheritHandle,
LPCWSTR  lpName 
)

◆ OpenWaitableTimerA()

WINPR_API HANDLE OpenWaitableTimerA ( DWORD  dwDesiredAccess,
BOOL  bInheritHandle,
LPCSTR  lpTimerName 
)

◆ OpenWaitableTimerW()

WINPR_API HANDLE OpenWaitableTimerW ( DWORD  dwDesiredAccess,
BOOL  bInheritHandle,
LPCWSTR  lpTimerName 
)

◆ ReleaseMutex()

WINPR_API BOOL ReleaseMutex ( HANDLE  hMutex)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReleaseSemaphore()

WINPR_API BOOL ReleaseSemaphore ( HANDLE  hSemaphore,
LONG  lReleaseCount,
LPLONG  lpPreviousCount 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ResetEvent()

WINPR_API BOOL ResetEvent ( HANDLE  hEvent)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetCriticalSectionSpinCount()

WINPR_API DWORD SetCriticalSectionSpinCount ( LPCRITICAL_SECTION  lpCriticalSection,
DWORD  dwSpinCount 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetEvent()

WINPR_API BOOL SetEvent ( HANDLE  hEvent)
Here is the call graph for this function:

◆ SetEventFileDescriptor()

WINPR_API int SetEventFileDescriptor ( HANDLE  hEvent,
int  FileDescriptor,
ULONG  mode 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetWaitableTimer()

WINPR_API BOOL SetWaitableTimer ( HANDLE  hTimer,
const LARGE_INTEGER *  lpDueTime,
LONG  lPeriod,
PTIMERAPCROUTINE  pfnCompletionRoutine,
LPVOID  lpArgToCompletionRoutine,
BOOL  fResume 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetWaitableTimerEx()

WINPR_API BOOL SetWaitableTimerEx ( HANDLE  hTimer,
const LARGE_INTEGER *  lpDueTime,
LONG  lPeriod,
PTIMERAPCROUTINE  pfnCompletionRoutine,
LPVOID  lpArgToCompletionRoutine,
PREASON_CONTEXT  WakeContext,
ULONG  TolerableDelay 
)
Here is the call graph for this function:

◆ SignalObjectAndWait()

WINPR_API DWORD SignalObjectAndWait ( HANDLE  hObjectToSignal,
HANDLE  hObjectToWaitOn,
DWORD  dwMilliseconds,
BOOL  bAlertable 
)
Here is the call graph for this function:

◆ Sleep()

WINPR_API VOID Sleep ( DWORD  dwMilliseconds)
Here is the caller graph for this function:

◆ SleepEx()

WINPR_API DWORD SleepEx ( DWORD  dwMilliseconds,
BOOL  bAlertable 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ TryEnterCriticalSection()

WINPR_API BOOL TryEnterCriticalSection ( LPCRITICAL_SECTION  lpCriticalSection)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ USleep()

WINPR_API VOID USleep ( DWORD  dwMicroseconds)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WaitForMultipleObjects()

WINPR_API DWORD WaitForMultipleObjects ( DWORD  nCount,
const HANDLE *  lpHandles,
BOOL  bWaitAll,
DWORD  dwMilliseconds 
)
Here is the call graph for this function:

◆ WaitForMultipleObjectsEx()

WINPR_API DWORD WaitForMultipleObjectsEx ( DWORD  nCount,
const HANDLE *  lpHandles,
BOOL  bWaitAll,
DWORD  dwMilliseconds,
BOOL  bAlertable 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WaitForSingleObject()

WINPR_API DWORD WaitForSingleObject ( HANDLE  hHandle,
DWORD  dwMilliseconds 
)
Here is the call graph for this function:

◆ WaitForSingleObjectEx()

WINPR_API DWORD WaitForSingleObjectEx ( HANDLE  hHandle,
DWORD  dwMilliseconds,
BOOL  bAlertable 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WaitOnAddress()

WINPR_API BOOL WaitOnAddress ( VOID volatile *  Address,
PVOID  CompareAddress,
SIZE_T  AddressSize,
DWORD  dwMilliseconds 
)

◆ WakeByAddressAll()

WINPR_API VOID WakeByAddressAll ( PVOID  Address)

WinPR: Windows Portable Runtime Synchronization Functions

Copyright 2012 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..nosp@m.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. WakeByAddressAll WakeByAddressSingle WaitOnAddress

◆ WakeByAddressSingle()

WINPR_API VOID WakeByAddressSingle ( PVOID  Address)

◆ winpr_DeleteSynchronizationBarrier()

WINPR_API BOOL WINAPI winpr_DeleteSynchronizationBarrier ( LPSYNCHRONIZATION_BARRIER  lpBarrier)

◆ winpr_EnterSynchronizationBarrier()

WINPR_API BOOL WINAPI winpr_EnterSynchronizationBarrier ( LPSYNCHRONIZATION_BARRIER  lpBarrier,
DWORD  dwFlags 
)

◆ winpr_InitializeSynchronizationBarrier()

WINPR_API BOOL WINAPI winpr_InitializeSynchronizationBarrier ( LPSYNCHRONIZATION_BARRIER  lpBarrier,
LONG  lTotalThreads,
LONG  lSpinCount 
)

◆ winpr_InitOnceBeginInitialize()

WINPR_API BOOL winpr_InitOnceBeginInitialize ( LPINIT_ONCE  lpInitOnce,
DWORD  dwFlags,
PBOOL  fPending,
LPVOID *  lpContext 
)

◆ winpr_InitOnceComplete()

WINPR_API BOOL winpr_InitOnceComplete ( LPINIT_ONCE  lpInitOnce,
DWORD  dwFlags,
LPVOID  lpContext 
)

◆ winpr_InitOnceExecuteOnce()

WINPR_API BOOL winpr_InitOnceExecuteOnce ( PINIT_ONCE  InitOnce,
PINIT_ONCE_FN  InitFn,
PVOID  Parameter,
LPVOID *  Context 
)
Here is the call graph for this function:

◆ winpr_InitOnceInitialize()

WINPR_API VOID winpr_InitOnceInitialize ( PINIT_ONCE  InitOnce)