diff options
Diffstat (limited to 'libglusterfs')
-rw-r--r-- | libglusterfs/src/common-utils.c | 11 | ||||
-rw-r--r-- | libglusterfs/src/common-utils.h | 3 |
2 files changed, 14 insertions, 0 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c index 1b02ca5f217..f013f93ee1e 100644 --- a/libglusterfs/src/common-utils.c +++ b/libglusterfs/src/common-utils.c @@ -4019,3 +4019,14 @@ out: return ret; } +void +_mask_cancellation (void) +{ + (void) pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, NULL); +} + +void +_unmask_cancellation (void) +{ + (void) pthread_setcancelstate (PTHREAD_CANCEL_ENABLE, NULL); +} diff --git a/libglusterfs/src/common-utils.h b/libglusterfs/src/common-utils.h index cbfb58068f2..cdd5e45c3e2 100644 --- a/libglusterfs/src/common-utils.h +++ b/libglusterfs/src/common-utils.h @@ -760,4 +760,7 @@ gf_nread (int fd, void *buf, size_t count); ssize_t gf_nwrite (int fd, const void *buf, size_t count); +void _mask_cancellation (void); +void _unmask_cancellation (void); + #endif /* _COMMON_UTILS_H */ |