LibC: Make pthread_{equal,self,testcancel} static inline

This allows using ::pthread_self or &pthread_self
This commit is contained in:
2026-06-29 14:09:37 +03:00
parent f121e80bfd
commit 6f002f0c07
2 changed files with 32 additions and 27 deletions

View File

@@ -490,20 +490,6 @@ void pthread_exit(void* value_ptr)
ASSERT_NOT_REACHED();
}
#undef pthread_equal
int pthread_equal(pthread_t t1, pthread_t t2)
{
return _pthread_equal(t1, t2);
}
#define pthread_equal(t1, t2) _pthread_equal(t1, t2)
#undef pthread_self
pthread_t pthread_self(void)
{
return _pthread_self();
}
#define pthread_self() _pthread_self()
int pthread_join(pthread_t thread, void** value_ptr)
{
do {
@@ -667,13 +653,6 @@ int pthread_setcanceltype(int type, int* oldtype)
return 0;
}
#undef pthread_testcancel
void pthread_testcancel(void)
{
_pthread_testcancel();
}
#define pthread_testcancel() _pthread_testcancel()
int pthread_getschedparam(pthread_t thread, int* __restrict policy, struct sched_param* __restrict param)
{
(void)thread;
@@ -1330,3 +1309,21 @@ extern "C" void* __attribute__((__regparm__(1))) ___tls_get_addr(tls_index* ti)
return reinterpret_cast<void*>(uthread->dtv[ti->ti_module] + ti->ti_offset);
}
#endif
#undef pthread_equal
int pthread_equal(pthread_t t1, pthread_t t2)
{
return _pthread_equal(t1, t2);
}
#undef pthread_self
pthread_t pthread_self(void)
{
return _pthread_self();
}
#undef pthread_testcancel
void pthread_testcancel(void)
{
_pthread_testcancel();
}