/** @brief Test for asyncrhonous thread cancellation (while deferred). * @par Alias: * This function is a weak defined symbol. * * This is a non-recursive replacement for the pthread library function, * pthread_testcancel(3). */ void pthread_testcancel(void) { /** If the weak undefined symbol, __pthread_testcancel() is loaded, a * suitable threads library exists and the library symbol is called. */ if (__pthread_testcancel) return __pthread_testcancel(); /** Otherwise, for non-threaded operation, this is a noop. */ return; }
int msync(__unused proc_t p, struct msync_args *uap, register_t *retval) { __pthread_testcancel(1); return(msync_nocancel(p, (struct msync_nocancel_args *)uap, retval)); }
int msgsnd(struct proc *p, struct msgsnd_args *uap, int32_t *retval) { __pthread_testcancel(1); return(msgsnd_nocancel(p, (struct msgsnd_nocancel_args *)uap, retval)); }