FreeRDP
|
#include <winpr/config.h>
#include <winpr/assert.h>
#include <winpr/tchar.h>
#include <winpr/synch.h>
#include <winpr/sysinfo.h>
#include <winpr/interlocked.h>
#include <winpr/thread.h>
#include "synch.h"
#include "../log.h"
Macros | |
#define | TAG WINPR_TAG("synch.critical") |
Functions | |
VOID | InitializeCriticalSection (LPCRITICAL_SECTION lpCriticalSection) |
BOOL | InitializeCriticalSectionEx (LPCRITICAL_SECTION lpCriticalSection, DWORD dwSpinCount, DWORD Flags) |
BOOL | InitializeCriticalSectionAndSpinCount (LPCRITICAL_SECTION lpCriticalSection, DWORD dwSpinCount) |
DWORD | SetCriticalSectionSpinCount (LPCRITICAL_SECTION lpCriticalSection, DWORD dwSpinCount) |
static VOID | WaitForCriticalSection (LPCRITICAL_SECTION lpCriticalSection) |
static VOID | UnWaitCriticalSection (LPCRITICAL_SECTION lpCriticalSection) |
VOID | EnterCriticalSection (LPCRITICAL_SECTION lpCriticalSection) |
BOOL | TryEnterCriticalSection (LPCRITICAL_SECTION lpCriticalSection) |
VOID | LeaveCriticalSection (LPCRITICAL_SECTION lpCriticalSection) |
VOID | DeleteCriticalSection (LPCRITICAL_SECTION lpCriticalSection) |
#define TAG WINPR_TAG("synch.critical") |
WinPR: Windows Portable Runtime Synchronization Functions
Copyright 2012 Marc-Andre Moreau marca Copyright 2013 Norbert Federa ndre .more au@g mail. comnorbe rt.f edera @thi ncast .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.
VOID DeleteCriticalSection | ( | LPCRITICAL_SECTION | lpCriticalSection | ) |
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 ...
VOID InitializeCriticalSection | ( | LPCRITICAL_SECTION | lpCriticalSection | ) |
BOOL InitializeCriticalSectionAndSpinCount | ( | LPCRITICAL_SECTION | lpCriticalSection, |
DWORD | dwSpinCount | ||
) |
BOOL InitializeCriticalSectionEx | ( | LPCRITICAL_SECTION | lpCriticalSection, |
DWORD | dwSpinCount, | ||
DWORD | Flags | ||
) |
See http://msdn.microsoft.com/en-us/library/ff541979(v=vs.85).aspx
VOID LeaveCriticalSection | ( | LPCRITICAL_SECTION | lpCriticalSection | ) |
DWORD SetCriticalSectionSpinCount | ( | LPCRITICAL_SECTION | lpCriticalSection, |
DWORD | dwSpinCount | ||
) |
BOOL TryEnterCriticalSection | ( | LPCRITICAL_SECTION | lpCriticalSection | ) |
|
static |
|
static |