Debian Codegraph @

po/ru/man3/pthread_cancel.3.po

raw
1 # Russian translation of manpages
2 # This file is distributed under the same license as the manpages-l10n package.
3 # Copyright © of this file:
4 # Alexey, 2016.
5 # Azamat Hackimov <[email protected]>, 2014-2017.
6 # kogamatranslator49 <[email protected]>, 2015.
7 # Darima Kogan <[email protected]>, 2014.
8 # Max Is <[email protected]>, 2016.
9 # Yuri Kozlov <[email protected]>, 2011-2019.
10 # Иван Павлов <[email protected]>, 2017.
11 msgid ""
12 msgstr ""
13 "Project-Id-Version: manpages-l10n\n"
14 "POT-Creation-Date: 2026-06-05 06:38+0200\n"
15 "PO-Revision-Date: 2024-12-21 19:50+0300\n"
16 "Last-Translator: Yuri Kozlov <[email protected]>\n"
17 "Language-Team: Russian <[email protected]>\n"
18 "Language: ru\n"
19 "MIME-Version: 1.0\n"
20 "Content-Type: text/plain; charset=UTF-8\n"
21 "Content-Transfer-Encoding: 8bit\n"
22 "Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
23 "n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || "
24 "(n%100>=11 && n%100<=14)? 2 : 3);\n"
25 "X-Generator: Lokalize 2.0\n"
26
27 #. type: TH
28 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
29 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
30 #, fuzzy, no-wrap
31 #| msgid "B<pthread_cancel>()"
32 msgid "pthread_cancel"
33 msgstr "B<pthread_cancel>()"
34
35 #. type: TH
36 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
37 #: opensuse-tumbleweed
38 #, no-wrap
39 msgid "2025-09-21"
40 msgstr "21 сентября 2025 г."
41
42 #. type: TH
43 #: archlinux debian-unstable
44 #, fuzzy, no-wrap
45 #| msgid "Linux man-pages 6.17"
46 msgid "Linux man-pages 6.18"
47 msgstr "Справочные страницы Linux 6.17"
48
49 #. type: SH
50 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
51 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
52 #, no-wrap
53 msgid "NAME"
54 msgstr "НАИМЕНОВАНИЕ"
55
56 #. type: Plain text
57 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
58 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
59 #, fuzzy
60 #| msgid "pthread_cancel - send a cancellation request to a thread"
61 msgid "pthread_cancel - send a cancelation request to a thread"
62 msgstr "pthread_cancel - посылает нити запрос отмены"
63
64 #. type: SH
65 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
66 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
67 #, no-wrap
68 msgid "LIBRARY"
69 msgstr "БИБЛИОТЕКА"
70
71 #. type: Plain text
72 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
73 #: opensuse-leap-16-1 opensuse-tumbleweed
74 msgid "POSIX threads library (I<libpthread>,\\ I<-lpthread>)"
75 msgstr "Библиотека потоков POSIX (I<libpthread>,\\ I<-lpthread>)"
76
77 #. type: SH
78 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
79 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
80 #, no-wrap
81 msgid "SYNOPSIS"
82 msgstr "СИНТАКСИС"
83
84 #. type: Plain text
85 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
86 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
87 #, no-wrap
88 msgid "B<#include E<lt>pthread.hE<gt>>\n"
89 msgstr "B<#include E<lt>pthread.hE<gt>>\n"
90
91 #. type: Plain text
92 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
93 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
94 #, no-wrap
95 msgid "B<int pthread_cancel(pthread_t >I<thread>B<);>\n"
96 msgstr "B<int pthread_cancel(pthread_t >I<thread>B<);>\n"
97
98 #. type: SH
99 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
100 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
101 #, no-wrap
102 msgid "DESCRIPTION"
103 msgstr "ОПИСАНИЕ"
104
105 #. type: Plain text
106 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
107 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
108 #, fuzzy
109 #| msgid ""
110 #| "The B<pthread_cancel>() function sends a cancellation request to the "
111 #| "thread I<thread>. Whether and when the target thread reacts to the "
112 #| "cancellation request depends on two attributes that are under the control "
113 #| "of that thread: its cancelability I<state> and I<type>."
114 msgid ""
115 "The B<pthread_cancel>() function sends a cancelation request to the thread "
116 "I<thread>. Whether and when the target thread reacts to the cancelation "
117 "request depends on two attributes that are under the control of that thread: "
118 "its cancelability I<state> and I<type>."
119 msgstr ""
120 "Функция B<pthread_cancel>() посылает нити I<thread> запрос отмены. "
121 "Отреагирует нити назначения и когда на запрос отмены зависит от двух "
122 "атрибутов, которые управляют этой нитью: I<состояние> и I<тип> возможности "
123 "отмены."
124
125 #. type: Plain text
126 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
127 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
128 #, fuzzy
129 #| msgid ""
130 #| "A thread's cancelability state, determined by "
131 #| "B<pthread_setcancelstate>(3), can be I<enabled> (the default for new "
132 #| "threads) or I<disabled>. If a thread has disabled cancellation, then a "
133 #| "cancellation request remains queued until the thread enables "
134 #| "cancellation. If a thread has enabled cancellation, then its "
135 #| "cancelability type determines when cancellation occurs."
136 msgid ""
137 "A thread's cancelability state, determined by B<pthread_setcancelstate>(3), "
138 "can be I<enabled> (the default for new threads) or I<disabled>. If a thread "
139 "has disabled cancelation, then a cancelation request remains queued until "
140 "the thread enables cancelation. If a thread has enabled cancelation, then "
141 "its cancelability type determines when cancelation occurs."
142 msgstr ""
143 "Состояние отменяемости нити, определённое в B<pthread_setcancelstate>(3), "
144 "может быть I<включено> (по умолчанию у новых нитей) или I<выключено>. Если "
145 "отменяемость у нити выключена, то запрос отменяемости остаётся в очереди до "
146 "тех пор, пока нить не включит отменяемость. Если отменяемость у нити "
147 "включена, то когда произойдёт отмена определяется типом отменяемости."
148
149 #. type: Plain text
150 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
151 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
152 #, fuzzy
153 #| msgid ""
154 #| "A thread's cancellation type, determined by B<pthread_setcanceltype>(3), "
155 #| "may be either I<asynchronous> or I<deferred> (the default for new "
156 #| "threads). Asynchronous cancelability means that the thread can be "
157 #| "canceled at any time (usually immediately, but the system does not "
158 #| "guarantee this). Deferred cancelability means that cancellation will be "
159 #| "delayed until the thread next calls a function that is a I<cancellation "
160 #| "point>. A list of functions that are or may be cancellation points is "
161 #| "provided in B<pthreads>(7)."
162 msgid ""
163 "A thread's cancelation type, determined by B<pthread_setcanceltype>(3), may "
164 "be either I<asynchronous> or I<deferred> (the default for new threads). "
165 "Asynchronous cancelability means that the thread can be canceled at any time "
166 "(usually immediately, but the system does not guarantee this). Deferred "
167 "cancelability means that cancelation will be delayed until the thread next "
168 "calls a function that is a I<cancelation point>. A list of functions that "
169 "are or may be cancelation points is provided in B<pthreads>(7)."
170 msgstr ""
171 "Тип отменяемости нити, определённый в B<pthread_setcanceltype>(3), может "
172 "быть I<асинхронным> или I<отложенным> (по умолчанию у новых нитей). "
173 "Асинхронная отменяемость означает, что нить может быть отменена в любое "
174 "время (обычно, немедленно, но система не гарантирует этого). Отложенная "
175 "отменяемость означает, что отмена будет задержана до тех пор, пока нить не "
176 "вызовет функцию, являющуюся I<точкой отмены>. Список функций, которые могут "
177 "быть точками отмены, представлен в B<pthreads>(7)."
178
179 #. type: Plain text
180 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
181 #: opensuse-leap-16-1 opensuse-tumbleweed
182 #, fuzzy
183 #| msgid ""
184 #| "When a cancellation requested is acted on, the following steps occur for "
185 #| "I<thread> (in this order):"
186 msgid ""
187 "When a cancelation request is acted on, the following steps occur for "
188 "I<thread> (in this order):"
189 msgstr ""
190 "Когда выполняется запрошенная отмена, для I<thread> выполняются следующие "
191 "шаги (в таком порядке):"
192
193 #. type: IP
194 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
195 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
196 #, no-wrap
197 msgid "(1)"
198 msgstr "(1)"
199
200 #. type: Plain text
201 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
202 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
203 #, fuzzy
204 #| msgid ""
205 #| "Cancellation clean-up handlers are popped (in the reverse of the order in "
206 #| "which they were pushed) and called. (See B<pthread_cleanup_push>(3).)"
207 msgid ""
208 "Cancelation clean-up handlers are popped (in the reverse of the order in "
209 "which they were pushed) and called. (See B<pthread_cleanup_push>(3).)"
210 msgstr ""
211 "Отмена поднимает очищающие обработчики (в обратном порядке их регистрации) и "
212 "они вызываются (смотрите B<pthread_cleanup_push>(3))."
213
214 #. type: IP
215 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
216 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
217 #, no-wrap
218 msgid "(2)"
219 msgstr "(2)"
220
221 #. type: Plain text
222 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
223 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
224 msgid ""
225 "Thread-specific data destructors are called, in an unspecified order. (See "
226 "B<pthread_key_create>(3).)"
227 msgstr ""
228 "Вызываются деструкторы данных нити, в неопределённом порядке (смотрите "
229 "B<pthread_key_create>(3))."
230
231 #. type: IP
232 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
233 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
234 #, no-wrap
235 msgid "(3)"
236 msgstr "(3)"
237
238 #. type: Plain text
239 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
240 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
241 msgid "The thread is terminated. (See B<pthread_exit>(3).)"
242 msgstr "Нить завершается (смотрите B<pthread_exit>(3))."
243
244 #. type: Plain text
245 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
246 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
247 #, fuzzy
248 #| msgid ""
249 #| "The above steps happen asynchronously with respect to the "
250 #| "B<pthread_cancel>() call; the return status of B<pthread_cancel>() "
251 #| "merely informs the caller whether the cancellation request was "
252 #| "successfully queued."
253 msgid ""
254 "The above steps happen asynchronously with respect to the "
255 "B<pthread_cancel>() call; the return status of B<pthread_cancel>() merely "
256 "informs the caller whether the cancelation request was successfully queued."
257 msgstr ""
258 "Приведённые выше шаги выполняются асинхронно по отношению к вызову "
259 "B<pthread_cancel>(); возвращаемое B<pthread_cancel>() состояние всего лишь "
260 "информирует вызывающего, что запрос отмены успешно попал в очередь."
261
262 #. type: Plain text
263 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
264 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
265 #, fuzzy
266 #| msgid ""
267 #| "After a canceled thread has terminated, a join with that thread using "
268 #| "B<pthread_join>(3) obtains B<PTHREAD_CANCELED> as the thread's exit "
269 #| "status. (Joining with a thread is the only way to know that cancellation "
270 #| "has completed.)"
271 msgid ""
272 "After a canceled thread has terminated, a join with that thread using "
273 "B<pthread_join>(3) obtains B<PTHREAD_CANCELED> as the thread's exit "
274 "status. (Joining with a thread is the only way to know that cancelation has "
275 "completed.)"
276 msgstr ""
277 "После завершения отменённой нити, при объединении с этой нитью с помощью "
278 "B<pthread_join>(3) возвращается B<PTHREAD_CANCELED> в качестве состояния "
279 "выхода (объединение с нитью — единственный способ узнать о завершении "
280 "отмены)."
281
282 #. type: SH
283 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
284 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
285 #, no-wrap
286 msgid "RETURN VALUE"
287 msgstr "ВОЗВРАЩАЕМОЕ ЗНАЧЕНИЕ"
288
289 #. type: Plain text
290 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
291 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
292 msgid ""
293 "On success, B<pthread_cancel>() returns 0; on error, it returns a nonzero "
294 "error number."
295 msgstr ""
296 "При успешном выполнении B<pthread_cancel>() возвращается 0; при ошибке "
297 "возвращается ненулевой номер ошибки."
298
299 #. type: SH
300 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
301 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
302 #, no-wrap
303 msgid "ERRORS"
304 msgstr "ОШИБКИ"
305
306 #. type: TP
307 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
308 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
309 #, no-wrap
310 msgid "B<ESRCH>"
311 msgstr "B<ESRCH>"
312
313 #. type: Plain text
314 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
315 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
316 msgid "No thread with the ID I<thread> could be found."
317 msgstr "Нить с идентификатором I<thread> не найдена."
318
319 #. type: SH
320 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
321 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
322 #, no-wrap
323 msgid "ATTRIBUTES"
324 msgstr "АТРИБУТЫ"
325
326 #. type: Plain text
327 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
328 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
329 msgid ""
330 "For an explanation of the terms used in this section, see B<attributes>(7)."
331 msgstr "Описание терминов данного раздела смотрите в B<attributes>(7)."
332
333 #. type: tbl table
334 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
335 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
336 #, no-wrap
337 msgid "Interface"
338 msgstr "Интерфейс"
339
340 #. type: tbl table
341 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
342 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
343 #, no-wrap
344 msgid "Attribute"
345 msgstr "Атрибут"
346
347 #. type: tbl table
348 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
349 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
350 #, no-wrap
351 msgid "Value"
352 msgstr "Значение"
353
354 #. type: tbl table
355 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
356 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
357 #, no-wrap
358 msgid ".na\n"
359 msgstr ".na\n"
360
361 #. type: tbl table
362 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
363 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
364 #, no-wrap
365 msgid ".nh\n"
366 msgstr ".nh\n"
367
368 #. type: tbl table
369 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
370 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
371 #, no-wrap
372 msgid "B<pthread_cancel>()"
373 msgstr "B<pthread_cancel>()"
374
375 #. type: tbl table
376 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
377 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
378 #, no-wrap
379 msgid "Thread safety"
380 msgstr "Безвредность в нитях"
381
382 #. type: tbl table
383 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
384 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
385 #, no-wrap
386 msgid "MT-Safe"
387 msgstr "MT-Safe"
388
389 #. type: SH
390 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
391 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
392 #, no-wrap
393 msgid "VERSIONS"
394 msgstr "ВЕРСИИ"
395
396 #. type: Plain text
397 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
398 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
399 #, fuzzy
400 #| msgid ""
401 #| "On Linux, cancellation is implemented using signals. Under the NPTL "
402 #| "threading implementation, the first real-time signal (i.e., signal 32) is "
403 #| "used for this purpose. On LinuxThreads, the second real-time signal is "
404 #| "used, if real-time signals are available, otherwise B<SIGUSR2> is used."
405 msgid ""
406 "On Linux, cancelation is implemented using signals. Under the NPTL "
407 "threading implementation, the first real-time signal (i.e., signal 32) is "
408 "used for this purpose. On LinuxThreads, the second real-time signal is "
409 "used, if real-time signals are available, otherwise B<SIGUSR2> is used."
410 msgstr ""
411 "В Linux отменяемость реализована с помощью сигналов. В реализации нитей NPTL "
412 "для этой цели используется первый сигнал реального времени (т. е., сигнал). "
413 "В LinuxThreads используется второй сигнал реального времени (если сигналы "
414 "реального времени доступны, в противном случае используется B<SIGUSR2>)."
415
416 #. type: SH
417 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
418 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
419 #, no-wrap
420 msgid "STANDARDS"
421 msgstr "СТАНДАРТЫ"
422
423 #. type: Plain text
424 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
425 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
426 msgid "POSIX.1-2008."
427 msgstr "POSIX.1-2008."
428
429 #. type: SH
430 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
431 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
432 #, no-wrap
433 msgid "HISTORY"
434 msgstr "ИСТОРИЯ"
435
436 #. type: Plain text
437 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
438 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
439 msgid "glibc 2.0 POSIX.1-2001."
440 msgstr "glibc 2.0 POSIX.1-2001."
441
442 #. type: SH
443 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
444 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
445 #, no-wrap
446 msgid "EXAMPLES"
447 msgstr "ПРИМЕРЫ"
448
449 #. type: Plain text
450 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
451 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
452 msgid ""
453 "The program below creates a thread and then cancels it. The main thread "
454 "joins with the canceled thread to check that its exit status was "
455 "B<PTHREAD_CANCELED>. The following shell session shows what happens when we "
456 "run the program:"
457 msgstr ""
458 "Программа, представленная ниже, создаёт нить и затем отменяет её. Главная "
459 "нить объединяется с отменённой нитью, чтобы получить состояние выхода "
460 "B<PTHREAD_CANCELED>. Далее представлен сеанс работы программы:"
461
462 #. type: Plain text
463 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
464 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
465 #, fuzzy, no-wrap
466 #| msgid ""
467 #| "$ ./a.out\n"
468 #| "thread_func(): started; cancellation disabled\n"
469 #| "main(): sending cancellation request\n"
470 #| "thread_func(): about to enable cancellation\n"
471 #| "main(): thread was canceled\n"
472 msgid ""
473 "$ ./a.out\n"
474 "thread_func(): started; cancelation disabled\n"
475 "main(): sending cancelation request\n"
476 "thread_func(): about to enable cancelation\n"
477 "main(): thread was canceled\n"
478 msgstr ""
479 "$ ./a.out\n"
480 "thread_func(): запущена; отмена выключена\n"
481 "main(): отправляем запрос отмены\n"
482 "thread_func(): для включения отмены\n"
483 "main(): нить была отменена\n"
484
485 #. type: SS
486 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
487 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
488 #, no-wrap
489 msgid "Program source"
490 msgstr "Исходный код программы"
491
492 #. type: Plain text
493 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
494 #: opensuse-tumbleweed
495 #, no-wrap
496 msgid ""
497 "#include E<lt>err.hE<gt>\n"
498 "#include E<lt>pthread.hE<gt>\n"
499 "#include E<lt>stdio.hE<gt>\n"
500 "#include E<lt>stdlib.hE<gt>\n"
501 "#include E<lt>unistd.hE<gt>\n"
502 "\\&\n"
503 "static void *\n"
504 "thread_func(void *ignored_argument)\n"
505 "{\n"
506 " int s;\n"
507 "\\&\n"
508 " /* Disable cancelation for a while, so that we don\\[aq]t\n"
509 " immediately react to a cancelation request. */\n"
510 "\\&\n"
511 " s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
512 " if (s != 0)\n"
513 " errc(EXIT_FAILURE, s, \"pthread_setcancelstate\");\n"
514 "\\&\n"
515 " printf(\"%s(): started; cancelation disabled\\[rs]n\", __func__);\n"
516 " sleep(5);\n"
517 " printf(\"%s(): about to enable cancelation\\[rs]n\", __func__);\n"
518 "\\&\n"
519 " s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
520 " if (s != 0)\n"
521 " errc(EXIT_FAILURE, s, \"pthread_setcancelstate\");\n"
522 "\\&\n"
523 " /* sleep() is a cancelation point. */\n"
524 "\\&\n"
525 " sleep(1000); /* Should get canceled while we sleep */\n"
526 "\\&\n"
527 " /* Should never get here. */\n"
528 "\\&\n"
529 " printf(\"%s(): not canceled!\\[rs]n\", __func__);\n"
530 " return NULL;\n"
531 "}\n"
532 "\\&\n"
533 "int\n"
534 "main(void)\n"
535 "{\n"
536 " pthread_t thr;\n"
537 " void *res;\n"
538 " int s;\n"
539 "\\&\n"
540 " /* Start a thread and then send it a cancelation request. */\n"
541 "\\&\n"
542 " s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
543 " if (s != 0)\n"
544 " errc(EXIT_FAILURE, s, \"pthread_create\");\n"
545 "\\&\n"
546 " sleep(2); /* Give thread a chance to get started */\n"
547 "\\&\n"
548 " printf(\"%s(): sending cancelation request\\[rs]n\", __func__);\n"
549 " s = pthread_cancel(thr);\n"
550 " if (s != 0)\n"
551 " errc(EXIT_FAILURE, s, \"pthread_cancel\");\n"
552 "\\&\n"
553 " /* Join with thread to see what its exit status was. */\n"
554 "\\&\n"
555 " s = pthread_join(thr, &res);\n"
556 " if (s != 0)\n"
557 " errc(EXIT_FAILURE, s, \"pthread_join\");\n"
558 "\\&\n"
559 " if (res == PTHREAD_CANCELED)\n"
560 " printf(\"%s(): thread was canceled\\[rs]n\", __func__);\n"
561 " else\n"
562 " printf(\"%s(): thread wasn\\[aq]t canceled (shouldn\\[aq]t happen!)\\[rs]n\",\n"
563 " __func__);\n"
564 " exit(EXIT_SUCCESS);\n"
565 "}\n"
566 msgstr ""
567
568 #. SRC END
569 #. type: SH
570 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
571 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
572 #, no-wrap
573 msgid "SEE ALSO"
574 msgstr "СМОТРИТЕ ТАКЖЕ"
575
576 #. type: Plain text
577 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
578 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
579 msgid ""
580 "B<pthread_cleanup_push>(3), B<pthread_create>(3), B<pthread_exit>(3), "
581 "B<pthread_join>(3), B<pthread_key_create>(3), B<pthread_setcancelstate>(3), "
582 "B<pthread_setcanceltype>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
583 msgstr ""
584 "B<pthread_cleanup_push>(3), B<pthread_create>(3), B<pthread_exit>(3), "
585 "B<pthread_join>(3), B<pthread_key_create>(3), B<pthread_setcancelstate>(3), "
586 "B<pthread_setcanceltype>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
587
588 #. type: TH
589 #: debian-trixie
590 #, no-wrap
591 msgid "2024-06-15"
592 msgstr "15 июня 2024 г."
593
594 #. type: TH
595 #: debian-trixie
596 #, no-wrap
597 msgid "Linux man-pages 6.9.1"
598 msgstr "Страницы руководства Linux 6.9.1"
599
600 #. type: Plain text
601 #: debian-trixie
602 msgid "POSIX threads library (I<libpthread>, I<-lpthread>)"
603 msgstr "Библиотека потоков POSIX (I<libpthread>, I<-lpthread>)"
604
605 #. type: Plain text
606 #: debian-trixie
607 #, fuzzy
608 #| msgid ""
609 #| "When a cancellation requested is acted on, the following steps occur for "
610 #| "I<thread> (in this order):"
611 msgid ""
612 "When a cancelation requested is acted on, the following steps occur for "
613 "I<thread> (in this order):"
614 msgstr ""
615 "Когда выполняется запрошенная отмена, для I<thread> выполняются следующие "
616 "шаги (в таком порядке):"
617
618 #. type: Plain text
619 #: debian-trixie fedora-44 fedora-rawhide
620 #, no-wrap
621 msgid ""
622 "#include E<lt>errno.hE<gt>\n"
623 "#include E<lt>pthread.hE<gt>\n"
624 "#include E<lt>stdio.hE<gt>\n"
625 "#include E<lt>stdlib.hE<gt>\n"
626 "#include E<lt>unistd.hE<gt>\n"
627 "\\&\n"
628 "#define handle_error_en(en, msg) \\[rs]\n"
629 " do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n"
630 "\\&\n"
631 "static void *\n"
632 "thread_func(void *ignored_argument)\n"
633 "{\n"
634 " int s;\n"
635 "\\&\n"
636 " /* Disable cancelation for a while, so that we don\\[aq]t\n"
637 " immediately react to a cancelation request. */\n"
638 "\\&\n"
639 " s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
640 " if (s != 0)\n"
641 " handle_error_en(s, \"pthread_setcancelstate\");\n"
642 "\\&\n"
643 " printf(\"%s(): started; cancelation disabled\\[rs]n\", __func__);\n"
644 " sleep(5);\n"
645 " printf(\"%s(): about to enable cancelation\\[rs]n\", __func__);\n"
646 "\\&\n"
647 " s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
648 " if (s != 0)\n"
649 " handle_error_en(s, \"pthread_setcancelstate\");\n"
650 "\\&\n"
651 " /* sleep() is a cancelation point. */\n"
652 "\\&\n"
653 " sleep(1000); /* Should get canceled while we sleep */\n"
654 "\\&\n"
655 " /* Should never get here. */\n"
656 "\\&\n"
657 " printf(\"%s(): not canceled!\\[rs]n\", __func__);\n"
658 " return NULL;\n"
659 "}\n"
660 "\\&\n"
661 "int\n"
662 "main(void)\n"
663 "{\n"
664 " pthread_t thr;\n"
665 " void *res;\n"
666 " int s;\n"
667 "\\&\n"
668 " /* Start a thread and then send it a cancelation request. */\n"
669 "\\&\n"
670 " s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
671 " if (s != 0)\n"
672 " handle_error_en(s, \"pthread_create\");\n"
673 "\\&\n"
674 " sleep(2); /* Give thread a chance to get started */\n"
675 "\\&\n"
676 " printf(\"%s(): sending cancelation request\\[rs]n\", __func__);\n"
677 " s = pthread_cancel(thr);\n"
678 " if (s != 0)\n"
679 " handle_error_en(s, \"pthread_cancel\");\n"
680 "\\&\n"
681 " /* Join with thread to see what its exit status was. */\n"
682 "\\&\n"
683 " s = pthread_join(thr, &res);\n"
684 " if (s != 0)\n"
685 " handle_error_en(s, \"pthread_join\");\n"
686 "\\&\n"
687 " if (res == PTHREAD_CANCELED)\n"
688 " printf(\"%s(): thread was canceled\\[rs]n\", __func__);\n"
689 " else\n"
690 " printf(\"%s(): thread wasn\\[aq]t canceled (shouldn\\[aq]t happen!)\\[rs]n\",\n"
691 " __func__);\n"
692 " exit(EXIT_SUCCESS);\n"
693 "}\n"
694 msgstr ""
695
696 #. type: TH
697 #: fedora-44 fedora-rawhide
698 #, no-wrap
699 msgid "2024-11-05"
700 msgstr "5 ноября 2024 г."
701
702 #. type: TH
703 #: fedora-44 fedora-rawhide
704 #, no-wrap
705 msgid "Linux man-pages 6.13"
706 msgstr "Страницы руководства Linux 6.13"
707
708 #. type: TH
709 #: mageia-cauldron
710 #, no-wrap
711 msgid "Linux man-pages 6.17"
712 msgstr "Страницы руководства Linux 6.17"
713
714 #. type: TH
715 #: opensuse-leap-16-1 opensuse-tumbleweed
716 #, no-wrap
717 msgid "Linux man-pages (unreleased)"
718 msgstr "Страницы руководства Linux (не выпущены)"