[*] Shorten LOC of AuOpen.Unix.cpp

This commit is contained in:
Reece Wilson 2024-01-20 20:27:25 +00:00
parent 648fbea6c1
commit 4f340aae47

View File

@ -14,7 +14,7 @@
namespace Aurora::Processes namespace Aurora::Processes
{ {
static void UnixOpenAsyncThread(const AuString &uri, bool bType) static void UnixOpenAsyncThread(AuString uri, bool bType)
{ {
bool bDirExists {}; bool bDirExists {};
bool bFileExists {}; bool bFileExists {};
@ -66,20 +66,7 @@ namespace Aurora::Processes
return; return;
} }
// TODO: No, just no. AuThreads::Spawn(std::bind(&UnixOpenAsyncThread, AuString(uri), bType), true);
auto thread = AuThreads::ThreadUnique(AuThreads::ThreadInfo(
AuMakeShared<AuThreads::IThreadVectorsFunctional>(AuThreads::IThreadVectorsFunctional::OnEntry_t(std::bind(std::bind(&UnixOpenAsyncThread, uri, bType))),
AuThreads::IThreadVectorsFunctional::OnExit_t{})
));
if (!thread)
{
SysPushErrorGeneric("no resource");
return;
}
thread->Run();
thread->Detach();
} }
AUKN_SYM void OpenUri(const AuString &uri) AUKN_SYM void OpenUri(const AuString &uri)