AuroraRuntime/Source/Threading/Threads/Threads.cpp
Reece fe529f3dc4 [+] Added AuroraInterface IThreadVectors for thread creation
[+] ThreadInfo's constructor now accepts additional arguments for name and stack
[*] Deprecate AbstractThreadVectors
[+] note about detaching threads
2021-10-23 19:25:43 +01:00

29 lines
635 B
C++

/***
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: Threads.cpp
Date: 2021-6-21
Author: Reece
***/
#include <Source/RuntimeInternal.hpp>
#include "Threads.hpp"
#include "OSThread.hpp"
namespace Aurora::Threading::Threads
{
AUKN_SYM IAuroraThread *ThreadNew(const ThreadInfo &info)
{
if (!info.callbacks && !(info.vectors.DoRun)) return {};
return _new OSThread(info);
}
AUKN_SYM void ThreadRelease(IAuroraThread *thread)
{
SafeDelete<OSThread *>(thread);
}
AUKN_SYM void TerminateCurrent()
{
GetThread()->Exit();
}
}