pthread_cancel.txt
来自「Pthread lib库完整说明文档」· 文本 代码 · 共 78 行
TXT
78 行
--------------------------------------------------------------------------------AIX Version 4.3 Base Operating System and Extensions Technical Reference, Volume 1--------------------------------------------------------------------------------pthread_cancel SubroutinePurposeRequests the cancellation of a thread.LibraryThreads Library (libpthreads.a)Syntax#include <pthread.h>int pthread_cancel (pthread_t thread);DescriptionThe pthread_cancel subroutine requests the cancellation of the thread thread. Theaction depends on the cancelability of the target thread: o If its cancelability is disabled, the cancellation request is set pending. o If its cancelability is deferred, the cancellation request is set pending till the thread reaches a cancellation point. o If its cancelability is asynchronous, the cancellation request is acted upon immediately; in some cases, it may result in unexpected behaviour.The cancellation of a thread terminates it safely, using the same terminationprocedure as the pthread_exit subroutine. Note: The pthread.h header file must be the first included file of each source file using the threads library. Otherwise, the -D_THREAD_SAFE compilation flag should be used, or the cc_r compiler used. In this case, the flag is automatically set.Parametersthread Specifies the thread to be canceled.Return ValuesIf successful, the pthread_cancel function returns zero. Otherwise, an errornumber is returned to indicate the error.Error CodesThe ptread_cancel function may fail if:ESRCH No thread could be found corresponding to that specified by the giventhread ID.The pthread_cancel function will not return an error code of EINTR.Implementation SpecificsThis subroutine is part of the Base Operating System (BOS) Runtime.Related InformationThe pthread_kill subroutine, pthread_exit subroutine, pthread_join subroutine,pthread_cond_wait, and pthread_cond_timedwait subroutines.The pthread.h file.Terminating Threads in AIX Version 4.3 General Programming Concepts: Writing andDebugging Programs.Threads Library Quick Reference in AIX Version 4.3 General Programming Concepts:Writing and Debugging Programs.--------------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?