diff options
| author | Samanta Navarro <ferivoz@riseup.net> | 2021-11-24 11:58:58 +0000 |
|---|---|---|
| committer | Alejandro Colomar <alx.manpages@gmail.com> | 2021-12-18 19:32:51 +0100 |
| commit | 1f08fc80e4573f8b6356296e511164477b935678 (patch) | |
| tree | ca414163a142e6675b64dc3a1a208b017ff48904 /man3 | |
| parent | 79c9fe57dd2164c1c58496034851fc499cc91958 (diff) | |
| download | man-pages-1f08fc80e4573f8b6356296e511164477b935678.tar.gz | |
pthread_cancel.3, pthread_cleanup_push_defer_np.3, pthread_setcancelstate.3, pthread_testcancel.3, pthreads.7: tfix
Changed cancellation to cancelation.
Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Diffstat (limited to 'man3')
| -rw-r--r-- | man3/error.3 | 2 | ||||
| -rw-r--r-- | man3/fopen.3 | 2 | ||||
| -rw-r--r-- | man3/getentropy.3 | 4 | ||||
| -rw-r--r-- | man3/pthread_cancel.3 | 52 | ||||
| -rw-r--r-- | man3/pthread_cleanup_push.3 | 16 | ||||
| -rw-r--r-- | man3/pthread_cleanup_push_defer_np.3 | 8 | ||||
| -rw-r--r-- | man3/pthread_kill_other_threads_np.3 | 2 | ||||
| -rw-r--r-- | man3/pthread_setcancelstate.3 | 26 | ||||
| -rw-r--r-- | man3/pthread_testcancel.3 | 8 |
9 files changed, 60 insertions, 60 deletions
diff --git a/man3/error.3 b/man3/error.3 index 673fe8ca06..38d04349b7 100644 --- a/man3/error.3 +++ b/man3/error.3 @@ -149,7 +149,7 @@ used once, it should be safe enough) and, if is set nonzero, the internal static variables (not exposed to users) used to hold the last printed filename and line number are accessed and modified without synchronization; the update is not atomic and it -occurs before disabling cancellation, so it can be interrupted only after +occurs before disabling cancelation, so it can be interrupted only after one of the two variables is modified. After that, .BR error_at_line () diff --git a/man3/fopen.3 b/man3/fopen.3 index a1d7817061..a16af1d7ff 100644 --- a/man3/fopen.3 +++ b/man3/fopen.3 @@ -327,7 +327,7 @@ The GNU C library allows the following extensions for the string specified in .BR c " (since glibc 2.3.3)" Do not make the open operation, or subsequent read and write operations, -thread cancellation points. +thread cancelation points. This flag is ignored for .BR fdopen (). .TP diff --git a/man3/getentropy.3 b/man3/getentropy.3 index dca0a8386e..4853009880 100644 --- a/man3/getentropy.3 +++ b/man3/getentropy.3 @@ -98,9 +98,9 @@ function is implemented using .PP Whereas the glibc wrapper makes .BR getrandom (2) -a cancellation point, +a cancelation point, .BR getentropy () -is not a cancellation point. +is not a cancelation point. .PP .BR getentropy () is also declared in diff --git a/man3/pthread_cancel.3 b/man3/pthread_cancel.3 index 01b7cf0210..cf390984e1 100644 --- a/man3/pthread_cancel.3 +++ b/man3/pthread_cancel.3 @@ -25,7 +25,7 @@ .\" .TH PTHREAD_CANCEL 3 2021-03-22 "Linux" "Linux Programmer's Manual" .SH NAME -pthread_cancel \- send a cancellation request to a thread +pthread_cancel \- send a cancelation request to a thread .SH SYNOPSIS .nf .B #include <pthread.h> @@ -37,10 +37,10 @@ Compile and link with \fI\-pthread\fP. .SH DESCRIPTION The .BR pthread_cancel () -function sends a cancellation request to the thread +function sends a cancelation request to the thread .IR thread . Whether and when the target thread -reacts to the cancellation request depends on +reacts to the cancelation request depends on two attributes that are under the control of that thread: its cancelability .I state @@ -53,13 +53,13 @@ can be .I enabled (the default for new threads) or .IR disabled . -If a thread has disabled cancellation, -then a cancellation request remains queued until the thread -enables cancellation. -If a thread has enabled cancellation, -then its cancelability type determines when cancellation occurs. +If a thread has disabled cancelation, +then a cancelation request remains queued until the thread +enables cancelation. +If a thread has enabled cancelation, +then its cancelability type determines when cancelation occurs. .PP -A thread's cancellation type, determined by +A thread's cancelation type, determined by .BR pthread_setcanceltype (3), may be either .IR asynchronous @@ -69,13 +69,13 @@ or Asynchronous cancelability means that the thread can be canceled at any time (usually immediately, but the system does not guarantee this). -Deferred cancelability means that cancellation will be delayed until +Deferred cancelability means that cancelation will be delayed until the thread next calls a function that is a -.IR "cancellation point" . -A list of functions that are or may be cancellation points is provided in +.IR "cancelation point" . +A list of functions that are or may be cancelation points is provided in .BR pthreads (7). .PP -When a cancellation requested is acted on, the following steps occur for +When a cancelation requested is acted on, the following steps occur for .IR thread (in this order): .IP 1. 3 @@ -98,7 +98,7 @@ The above steps happen asynchronously with respect to the call; the return status of .BR pthread_cancel () -merely informs the caller whether the cancellation request +merely informs the caller whether the cancelation request was successfully queued. .PP After a canceled thread has terminated, @@ -107,7 +107,7 @@ a join with that thread using obtains .B PTHREAD_CANCELED as the thread's exit status. -(Joining with a thread is the only way to know that cancellation +(Joining with a thread is the only way to know that cancelation has completed.) .SH RETURN VALUE On success, @@ -142,7 +142,7 @@ T} Thread safety MT-Safe .SH CONFORMING TO POSIX.1-2001, POSIX.1-2008. .SH NOTES -On Linux, cancellation is implemented using signals. +On Linux, cancelation is implemented using signals. Under the NPTL threading implementation, the first real-time signal (i.e., signal 32) is used for this purpose. On LinuxThreads, the second real-time signal is used, @@ -159,9 +159,9 @@ The following shell session shows what happens when we run the program: .in +4n .EX $ ./a.out -thread_func(): started; cancellation disabled -main(): sending cancellation request -thread_func(): about to enable cancellation +thread_func(): started; cancelation disabled +main(): sending cancelation request +thread_func(): about to enable cancelation main(): thread was canceled .EE .in @@ -182,22 +182,22 @@ thread_func(void *ignored_argument) { int s; - /* Disable cancellation for a while, so that we don\(aqt - immediately react to a cancellation request. */ + /* Disable cancelation for a while, so that we don\(aqt + immediately react to a cancelation request. */ s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); if (s != 0) handle_error_en(s, "pthread_setcancelstate"); - printf("thread_func(): started; cancellation disabled\en"); + printf("thread_func(): started; cancelation disabled\en"); sleep(5); - printf("thread_func(): about to enable cancellation\en"); + printf("thread_func(): about to enable cancelation\en"); s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); if (s != 0) handle_error_en(s, "pthread_setcancelstate"); - /* sleep() is a cancellation point. */ + /* sleep() is a cancelation point. */ sleep(1000); /* Should get canceled while we sleep */ @@ -214,7 +214,7 @@ main(void) void *res; int s; - /* Start a thread and then send it a cancellation request. */ + /* Start a thread and then send it a cancelation request. */ s = pthread_create(&thr, NULL, &thread_func, NULL); if (s != 0) @@ -222,7 +222,7 @@ main(void) sleep(2); /* Give thread a chance to get started */ - printf("main(): sending cancellation request\en"); + printf("main(): sending cancelation request\en"); s = pthread_cancel(thr); if (s != 0) handle_error_en(s, "pthread_cancel"); diff --git a/man3/pthread_cleanup_push.3 b/man3/pthread_cleanup_push.3 index 7960315b38..0263248a23 100644 --- a/man3/pthread_cleanup_push.3 +++ b/man3/pthread_cleanup_push.3 @@ -26,7 +26,7 @@ .TH PTHREAD_CLEANUP_PUSH 3 2021-03-22 "Linux" "Linux Programmer's Manual" .SH NAME pthread_cleanup_push, pthread_cleanup_pop \- push and pop -thread cancellation clean-up handlers +thread cancelation clean-up handlers .SH SYNOPSIS .nf .B #include <pthread.h> @@ -38,7 +38,7 @@ Compile and link with \fI\-pthread\fP. .fi .SH DESCRIPTION These functions manipulate the calling thread's stack of -thread-cancellation clean-up handlers. +thread-cancelation clean-up handlers. A clean-up handler is a function that is automatically executed when a thread is canceled (or in various other circumstances described below); @@ -63,7 +63,7 @@ and optionally executes it if .I execute is nonzero. .PP -A cancellation clean-up handler is popped from the stack +A cancelation clean-up handler is popped from the stack and executed in the following circumstances: .IP 1. 3 When a thread is canceled, @@ -180,13 +180,13 @@ This loop increments a global variable, .IR cnt , once each second. Depending on what command-line arguments are supplied, -the main thread sends the other thread a cancellation request, +the main thread sends the other thread a cancelation request, or sets a global variable that causes the other thread to exit its loop and terminate normally (by doing a .IR return ). .PP In the following shell session, -the main thread sends a cancellation request to the other thread: +the main thread sends a cancelation request to the other thread: .PP .in +4n .EX @@ -201,7 +201,7 @@ Thread was canceled; cnt = 0 .in .PP From the above, we see that the thread was canceled, -and that the cancellation clean-up handler was called +and that the cancelation clean-up handler was called and it reset the value of the global variable .I cnt to 0. @@ -281,10 +281,10 @@ thread_start(void *arg) curr = start = time(NULL); while (!done) { - pthread_testcancel(); /* A cancellation point */ + pthread_testcancel(); /* A cancelation point */ if (curr < time(NULL)) { curr = time(NULL); - printf("cnt = %d\en", cnt); /* A cancellation point */ + printf("cnt = %d\en", cnt); /* A cancelation point */ cnt++; } } diff --git a/man3/pthread_cleanup_push_defer_np.3 b/man3/pthread_cleanup_push_defer_np.3 index c5096d11ec..27ce08c141 100644 --- a/man3/pthread_cleanup_push_defer_np.3 +++ b/man3/pthread_cleanup_push_defer_np.3 @@ -26,7 +26,7 @@ .TH PTHREAD_CLEANUP_PUSH_DEFER_NP 3 2021-03-22 "Linux" "Linux Programmer's Manual" .SH NAME pthread_cleanup_push_defer_np, pthread_cleanup_pop_restore_np \- push and pop -thread cancellation clean-up handlers while saving cancelability type +thread cancelation clean-up handlers while saving cancelability type .SH SYNOPSIS .nf .B #include <pthread.h> @@ -59,11 +59,11 @@ Like .BR pthread_cleanup_push_defer_np () pushes .I routine -onto the thread's stack of cancellation clean-up handlers. +onto the thread's stack of cancelation clean-up handlers. In addition, it also saves the thread's current cancelability type, and sets the cancelability type to "deferred" (see .BR pthread_setcanceltype (3)); -this ensures that cancellation clean-up will occur +this ensures that cancelation clean-up will occur even if the thread's cancelability type was "asynchronous" before the call. .PP @@ -71,7 +71,7 @@ Like .BR pthread_cleanup_pop (3), .BR pthread_cleanup_pop_restore_np () pops the top-most clean-up handler from the thread's -stack of cancellation clean-up handlers. +stack of cancelation clean-up handlers. In addition, it restores the thread's cancelability type to its value at the time of the matching .BR pthread_cleanup_push_defer_np (). diff --git a/man3/pthread_kill_other_threads_np.3 b/man3/pthread_kill_other_threads_np.3 index 031f289dfb..ce490af6bb 100644 --- a/man3/pthread_kill_other_threads_np.3 +++ b/man3/pthread_kill_other_threads_np.3 @@ -39,7 +39,7 @@ On that implementation, calling this function causes the immediate termination of all threads in the application, except the calling thread. -The cancellation state and cancellation type of the +The cancelation state and cancelation type of the to-be-terminated threads are ignored, and the cleanup handlers are not called in those threads. .\" .SH VERSIONS diff --git a/man3/pthread_setcancelstate.3 b/man3/pthread_setcancelstate.3 index 56e2acf100..e0c7463540 100644 --- a/man3/pthread_setcancelstate.3 +++ b/man3/pthread_setcancelstate.3 @@ -54,11 +54,11 @@ The thread is cancelable. This is the default cancelability state in all new threads, including the initial thread. The thread's cancelability type determines when a cancelable thread -will respond to a cancellation request. +will respond to a cancelation request. .TP .B PTHREAD_CANCEL_DISABLE The thread is not cancelable. -If a cancellation request is received, +If a cancelation request is received, it is blocked until cancelability is enabled. .PP The @@ -74,21 +74,21 @@ The argument must have one of the following values: .TP .B PTHREAD_CANCEL_DEFERRED -A cancellation request is deferred until the thread next calls -a function that is a cancellation point (see +A cancelation request is deferred until the thread next calls +a function that is a cancelation point (see .BR pthreads (7)). This is the default cancelability type in all new threads, including the initial thread. .IP -Even with deferred cancellation, a -cancellation point in an asynchronous signal handler may still +Even with deferred cancelation, a +cancelation point in an asynchronous signal handler may still be acted upon and the effect is as if it was an asynchronous -cancellation. +cancelation. .TP .B PTHREAD_CANCEL_ASYNCHRONOUS The thread can be canceled at any time. (Typically, -it will be canceled immediately upon receiving a cancellation request, +it will be canceled immediately upon receiving a cancelation request, but the system doesn't guarantee this.) .PP The set-and-get operation performed by each of these functions @@ -150,10 +150,10 @@ For details of what happens when a thread is canceled, see .PP Briefly disabling cancelability is useful if a thread performs some critical action -that must not be interrupted by a cancellation request. +that must not be interrupted by a cancelation request. Beware of disabling cancelability for long periods, or around operations that may block for long periods, -since that will render the thread unresponsive to cancellation requests. +since that will render the thread unresponsive to cancelation requests. .SS Asynchronous cancelability Setting the cancelability type to .B PTHREAD_CANCEL_ASYNCHRONOUS @@ -165,13 +165,13 @@ time, it cannot safely reserve resources (e.g., allocating memory with acquire mutexes, semaphores, or locks, and so on. Reserving resources is unsafe because the application has no way of knowing what the state of these resources is when the thread is canceled; -that is, did cancellation occur before the resources were reserved, +that is, did cancelation occur before the resources were reserved, while they were reserved, or after they were released? Furthermore, some internal data structures (e.g., the linked list of free blocks managed by the .BR malloc (3) family of functions) may be left in an inconsistent state -if cancellation occurs in the middle of the function call. +if cancelation occurs in the middle of the function call. Consequently, clean-up handlers cease to be useful. .PP Functions that can be safely asynchronously canceled are called @@ -186,7 +186,7 @@ In general, other library functions can't be safely called from an asynchronously cancelable thread. .PP One of the few circumstances in which asynchronous cancelability is useful -is for cancellation of a thread that is in a pure compute-bound loop. +is for cancelation of a thread that is in a pure compute-bound loop. .SS Portability notes The Linux threading implementations permit the .I oldstate diff --git a/man3/pthread_testcancel.3 b/man3/pthread_testcancel.3 index 8dc2d61227..42f34a2ed0 100644 --- a/man3/pthread_testcancel.3 +++ b/man3/pthread_testcancel.3 @@ -25,7 +25,7 @@ .\" .TH PTHREAD_TESTCANCEL 3 2021-03-22 "Linux" "Linux Programmer's Manual" .SH NAME -pthread_testcancel \- request delivery of any pending cancellation request +pthread_testcancel \- request delivery of any pending cancelation request .SH SYNOPSIS .nf .B #include <pthread.h> @@ -37,13 +37,13 @@ Compile and link with \fI\-pthread\fP. .SH DESCRIPTION Calling .BR pthread_testcancel () -creates a cancellation point within the calling thread, +creates a cancelation point within the calling thread, so that a thread that is otherwise executing code that contains -no cancellation points will respond to a cancellation request. +no cancelation points will respond to a cancelation request. .PP If cancelability is disabled (using .BR pthread_setcancelstate (3)), -or no cancellation request is pending, +or no cancelation request is pending, then a call to .BR pthread_testcancel () has no effect. |
