1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

Lazy<T>, LazyTLS<T>, thread dtors

This commit is contained in:
Brian Fiete 2022-07-04 10:20:38 -07:00
parent cf269db0eb
commit a27ef9beda
17 changed files with 437 additions and 30 deletions

View file

@ -38,7 +38,7 @@ namespace System.Diagnostics
}
}
static Result<ProfileId> StartSampling(int32 threadId, StringView profileDesc)
static Result<ProfileId> StartSampling(int threadId, StringView profileDesc)
{
//int32 curId = Interlocked.Increment(ref gProfileId);
int32 curId = gProfileId++;

View file

@ -95,7 +95,7 @@ namespace System
extension Result<T> where T : IDisposable
{
public void Dispose()
public new void Dispose()
{
if (this case .Ok(var val))
val.Dispose();
@ -199,7 +199,7 @@ namespace System
extension Result<T, TErr> where T : IDisposable
{
public void Dispose()
public new void Dispose()
{
if (this case .Ok(var val))
val.Dispose();
@ -208,7 +208,7 @@ namespace System
extension Result<T, TErr> where TErr : IDisposable
{
public void Dispose()
public new void Dispose()
{
if (this case .Err(var err))
err.Dispose();
@ -217,7 +217,7 @@ namespace System
extension Result<T, TErr> where T : IDisposable where TErr : IDisposable
{
public void Dispose()
public new void Dispose()
{
if (this case .Ok(var val))
val.Dispose();

View file

@ -7,7 +7,7 @@ namespace System
[StaticInitPriority(100)]
class Runtime
{
const int32 cVersion = 9;
const int32 cVersion = 10;
[CRepr, AlwaysInclude]
struct BfDebugMessageData
@ -116,6 +116,7 @@ namespace System
function bool (Object thread) mThread_IsAutoDelete;
function void (Object thread) mThread_AutoDelete;
function int32 (Object thread) mThread_GetMaxStackSize;
function void () mThread_Exiting;
function void () mGC_MarkAllStaticMembers;
function bool () mGC_CallRootCallbacks;
function void () mGC_Shutdown;

View file

@ -78,6 +78,11 @@ namespace System.Threading
}
}
static void Thread_Exiting()
{
}
public static this()
{
var cb = ref Runtime.BfRtCallbacks.[Friend]sCallbacks;
@ -90,6 +95,7 @@ namespace System.Threading
cb.[Friend]mThread_IsAutoDelete = => Thread_IsAutoDelete;
cb.[Friend]mThread_AutoDelete = => Thread_AutoDelete;
cb.[Friend]mThread_GetMaxStackSize = => Thread_GetMaxStackSize;
cb.[Friend]mThread_Exiting = => Thread_Exiting;
}
}
@ -280,9 +286,10 @@ namespace System.Threading
}
}
extern int32 GetThreadId();
[CallingConvention(.Cdecl)]
extern int GetThreadId();
public int32 Id
public int Id
{
get
{