UDocumentation
UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
PThreadsRecursiveMutex.h
Go to the documentation of this file.
1
// Copyright Epic Games, Inc. All Rights Reserved.
2
3
#pragma once
4
5
// HEADER_UNIT_UNSUPPORTED - Unsupported platform
6
7
#include "
CoreTypes.h
"
8
9
#if PLATFORM_USE_PTHREADS
10
11
#include <pthread.h>
12
#include <errno.h>
13
14
namespace
UE
15
{
16
22
class
FPThreadsRecursiveMutex
final
23
{
24
public
:
25
FPThreadsRecursiveMutex
(
const
FPThreadsRecursiveMutex
&) =
delete
;
26
FPThreadsRecursiveMutex
& operator=(
const
FPThreadsRecursiveMutex
&) =
delete
;
27
28
inline
FPThreadsRecursiveMutex
()
29
{
30
pthread_mutexattr_t
MutexAttributes
;
31
pthread_mutexattr_init
(&
MutexAttributes
);
32
pthread_mutexattr_settype
(&
MutexAttributes
,
PTHREAD_MUTEX_RECURSIVE
);
33
pthread_mutex_init
(&Mutex, &
MutexAttributes
);
34
pthread_mutexattr_destroy
(&
MutexAttributes
);
35
}
36
37
UE_FORCEINLINE_HINT
~FPThreadsRecursiveMutex
()
38
{
39
pthread_mutex_destroy
(&Mutex);
40
}
41
42
UE_FORCEINLINE_HINT
bool
TryLock()
43
{
44
return
pthread_mutex_trylock
(&Mutex) == 0;
45
}
46
47
UE_FORCEINLINE_HINT
void
Lock
()
48
{
49
pthread_mutex_lock
(&Mutex);
50
}
51
52
UE_FORCEINLINE_HINT
void
Unlock()
53
{
54
pthread_mutex_unlock
(&Mutex);
55
}
56
57
private
:
58
pthread_mutex_t
Mutex
;
59
};
60
61
}
// UE
62
63
#endif
// PLATFORM_USE_PTHREADS
CoreTypes.h
UE_FORCEINLINE_HINT
#define UE_FORCEINLINE_HINT
Definition
Platform.h:723
StaticCastSharedRef
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition
SharedPointer.h:127
Lock
FRWLock Lock
Definition
UnversionedPropertySerialization.cpp:921
MeshPaintVirtualTexture::Mutex
UE::FRecursiveMutex Mutex
Definition
MeshPaintVirtualTexture.cpp:164
UE
Definition
AdvancedWidgetsModule.cpp:13
Engine
Source
Runtime
Core
Public
HAL
PThreadsRecursiveMutex.h
Generated by
1.9.8