MCPcopy Create free account
hub / github.com/DaedalusX64/daedalus / CreateThread

Function CreateThread

Source/SysPosix/Utility/ThreadPosix.cpp:78–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76} // anonymous namespace
77
78ThreadHandle CreateThread( const char * name, DaedThread function, void * argument )
79{
80 pthread_t thread;
81 pthread_attr_t thread_attr;
82
83 pthread_attr_init( &thread_attr );
84
85 SDaedThreadDetails * thread_details = new SDaedThreadDetails( function, argument );
86
87 s32 result = ::pthread_create( &thread, &thread_attr, &StartThreadFunc, thread_details );
88 if(result == 0)
89 {
90 return PthreadToHandle( thread );
91 }
92
93 pthread_attr_destroy( &thread_attr );
94 return kInvalidThreadHandle;
95}
96
97void SetThreadPriority( ThreadHandle handle, EThreadPriority pri )
98{

Callers

nothing calls this directly

Calls 1

PthreadToHandleFunction · 0.85

Tested by

no test coverage detected