The intent of this is to avoid name space pollution of the C threads implementation. This has two sides to it. First we have to provide symbols that wouldn't pollute the name space for the C threads implementation. Second we have to clean up some internal uses of POSIX functions such that they don't implicitly drag in such symbols.
14 lines
337 B
C
14 lines
337 B
C
#include "pthread_impl.h"
|
|
|
|
int __pthread_setcancelstate(int new, int *old)
|
|
{
|
|
if (new > 1U) return EINVAL;
|
|
if (!libc.has_thread_pointer) return ENOSYS;
|
|
struct pthread *self = __pthread_self();
|
|
if (old) *old = self->canceldisable;
|
|
self->canceldisable = new;
|
|
return 0;
|
|
}
|
|
|
|
weak_alias(__pthread_setcancelstate, pthread_setcancelstate);
|