Logo
Explore Help
Sign In
fluencelabs/musl
1
0
Fork 0
You've already forked musl
mirror of https://github.com/fluencelabs/musl synced 2025-05-31 00:21:34 +00:00
Code Issues Projects Releases Wiki Activity
musl/src/thread/pthread_setcancelstate.c

11 lines
266 B
C
Raw Normal View History

initial check-in, version 0.5.0
2011-02-12 00:22:29 -05:00
#include "pthread_impl.h"
int pthread_setcancelstate(int new, int *old)
{
struct pthread *self = pthread_self();
new framework to inhibit thread cancellation when needed with these small changes, libc functions which need to call functions which are cancellation points, but which themselves must not be cancellation points, can use the CANCELPT_INHIBIT and CANCELPT_RESUME macros to temporarily inhibit all cancellation.
2011-04-05 18:00:28 -04:00
if (old) *old = self->canceldisable & 1;
initial check-in, version 0.5.0
2011-02-12 00:22:29 -05:00
if ((unsigned)new > 1) return EINVAL;
new framework to inhibit thread cancellation when needed with these small changes, libc functions which need to call functions which are cancellation points, but which themselves must not be cancellation points, can use the CANCELPT_INHIBIT and CANCELPT_RESUME macros to temporarily inhibit all cancellation.
2011-04-05 18:00:28 -04:00
self->canceldisable = (self->canceldisable & ~1) | new;
initial check-in, version 0.5.0
2011-02-12 00:22:29 -05:00
return 0;
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 84ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API