mirror of
https://github.com/fluencelabs/musl
synced 2025-06-01 09:01:40 +00:00
we take advantage of the fact that unless self->cancelpt is 1, cancellation cannot happen. so just increment it by 2 to temporarily block cancellation. this drops pthread_create.o well under 1k.
11 lines
224 B
C
11 lines
224 B
C
#include "pthread_impl.h"
|
|
|
|
int pthread_setcancelstate(int new, int *old)
|
|
{
|
|
struct pthread *self = pthread_self();
|
|
if (old) *old = self->canceldisable;
|
|
if (new > 1U) return EINVAL;
|
|
self->canceldisable = new;
|
|
return 0;
|
|
}
|