UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ApplePlatformTLS.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3/*=============================================================================================
4 ApplePlatformTLS.h: Apple platform TLS (Thread local storage and thread ID) functions
5==============================================================================================*/
6
7#pragma once
9#include "CoreTypes.h"
10#if PLATFORM_MAC
12#elif PLATFORM_IOS
14#endif
15
20{
28
32 static inline uint32 AllocTlsSlot(void)
33 {
34 // allocate a per-thread mem slot
37 {
38 SlotKey = InvalidTlsSlot; // matches the Windows TlsAlloc() retval.
39 }
40 return SlotKey;
41 }
42
49 static UE_FORCEINLINE_HINT void SetTlsValue(uint32 SlotIndex,void* Value)
50 {
52 }
53
59 static UE_FORCEINLINE_HINT void* GetTlsValue(uint32 SlotIndex)
60 {
61 return pthread_getspecific((pthread_key_t)SlotIndex);
62 }
63
69 static UE_FORCEINLINE_HINT void FreeTlsSlot(uint32 SlotIndex)
70 {
72 }
73};
74
#define NULL
Definition oodle2base.h:134
FApplePlatformTLS FPlatformTLS
Definition ApplePlatformTLS.h:75
#define UE_FORCEINLINE_HINT
Definition Platform.h:723
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition ApplePlatformTLS.h:20
static UE_FORCEINLINE_HINT void SetTlsValue(uint32 SlotIndex, void *Value)
Definition ApplePlatformTLS.h:49
static uint32 AllocTlsSlot(void)
Definition ApplePlatformTLS.h:32
static UE_FORCEINLINE_HINT void * GetTlsValue(uint32 SlotIndex)
Definition ApplePlatformTLS.h:59
static UE_FORCEINLINE_HINT uint32 GetCurrentThreadId(void)
Definition ApplePlatformTLS.h:24
static UE_FORCEINLINE_HINT void FreeTlsSlot(uint32 SlotIndex)
Definition ApplePlatformTLS.h:69
Definition GenericPlatformTLS.h:12
static const uint32 InvalidTlsSlot
Definition GenericPlatformTLS.h:13