FreeRDP
mutex.c File Reference
#include <winpr/config.h>
#include <winpr/synch.h>
#include <winpr/debug.h>
#include <winpr/wlog.h>
#include <winpr/string.h>
#include "synch.h"
#include <errno.h>
#include "../handle/handle.h"
#include "../log.h"

Macros

#define TAG   WINPR_TAG("sync.mutex")
 

Functions

static BOOL MutexCloseHandle (HANDLE handle)
 
static BOOL MutexIsHandled (HANDLE handle)
 
static int MutexGetFd (HANDLE handle)
 
HANDLE CreateMutexW (LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner, LPCWSTR lpName)
 
HANDLE CreateMutexA (LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner, LPCSTR lpName)
 
HANDLE CreateMutexExA (LPSECURITY_ATTRIBUTES lpMutexAttributes, LPCSTR lpName, DWORD dwFlags, DWORD dwDesiredAccess)
 
HANDLE CreateMutexExW (LPSECURITY_ATTRIBUTES lpMutexAttributes, LPCWSTR lpName, DWORD dwFlags, DWORD dwDesiredAccess)
 
HANDLE OpenMutexA (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName)
 
HANDLE OpenMutexW (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName)
 
BOOL ReleaseMutex (HANDLE hMutex)
 

Variables

static HANDLE_OPS ops
 

Macro Definition Documentation

◆ TAG

#define TAG   WINPR_TAG("sync.mutex")

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.

Function Documentation

◆ CreateMutexA()

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()

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

◆ CreateMutexExW()

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

◆ CreateMutexW()

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:

◆ MutexCloseHandle()

BOOL MutexCloseHandle ( HANDLE  handle)
static

Note: unfortunately we may not return FALSE here since CloseHandle(hmutex) on Windows always seems to succeed independently of the mutex object locking state

Here is the call graph for this function:

◆ MutexGetFd()

static int MutexGetFd ( HANDLE  handle)
static
Here is the call graph for this function:

◆ MutexIsHandled()

static BOOL MutexIsHandled ( HANDLE  handle)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ OpenMutexA()

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

◆ OpenMutexW()

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

◆ ReleaseMutex()

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

Variable Documentation

◆ ops

HANDLE_OPS ops
static
Initial value:
NULL,
NULL }
if availableBytes return NULL
Definition: TPCircularBuffer.h:109
static BOOL MutexIsHandled(HANDLE handle)
Definition: mutex.c:40
static BOOL MutexCloseHandle(HANDLE handle)
Definition: mutex.c:57
static int MutexGetFd(HANDLE handle)
Definition: mutex.c:45