Debian Codegraph @

po/ro/man3/pthread_cancel.3.po

raw
1 # Romanian translation of manpages
2 # This file is distributed under the same license as the manpages-l10n package.
3 # Copyright © of this file:
4 # Remus-Gabriel Chelu <[email protected]>, 2024, 2025.
5 msgid ""
6 msgstr ""
7 "Project-Id-Version: manpages-l10n 4.24.0\n"
8 "POT-Creation-Date: 2026-06-05 06:38+0200\n"
9 "PO-Revision-Date: 2025-11-05 19:16+0100\n"
10 "Last-Translator: Remus-Gabriel Chelu <[email protected]>\n"
11 "Language-Team: Romanian <[email protected]>\n"
12 "Language: ro\n"
13 "MIME-Version: 1.0\n"
14 "Content-Type: text/plain; charset=UTF-8\n"
15 "Content-Transfer-Encoding: 8bit\n"
16 "Plural-Forms: nplurals=3; plural=n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < "
17 "20)) ? 1 : 2;\n"
18 "X-Generator: Poedit 3.6\n"
19
20 #. type: TH
21 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
22 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
23 #, no-wrap
24 msgid "pthread_cancel"
25 msgstr "pthread_cancel"
26
27 #. type: TH
28 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
29 #: opensuse-tumbleweed
30 #, no-wrap
31 msgid "2025-09-21"
32 msgstr "21 septembrie 2025"
33
34 #. type: TH
35 #: archlinux debian-unstable
36 #, no-wrap
37 msgid "Linux man-pages 6.18"
38 msgstr "Pagini de manual de Linux 6.18"
39
40 #. type: SH
41 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
42 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
43 #, no-wrap
44 msgid "NAME"
45 msgstr "NUME"
46
47 #. type: Plain text
48 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
49 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
50 msgid "pthread_cancel - send a cancelation request to a thread"
51 msgstr "pthread_cancel - trimite o cerere de anulare către un fir"
52
53 #. type: SH
54 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
55 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
56 #, no-wrap
57 msgid "LIBRARY"
58 msgstr "BIBLIOTECA"
59
60 #. type: Plain text
61 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
62 #: opensuse-leap-16-1 opensuse-tumbleweed
63 msgid "POSIX threads library (I<libpthread>,\\ I<-lpthread>)"
64 msgstr "Biblioteca de fire de execuție POSIX (I<libpthread>, I<-lpthread>)"
65
66 #. type: SH
67 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
68 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
69 #, no-wrap
70 msgid "SYNOPSIS"
71 msgstr "SINOPSIS"
72
73 #. type: Plain text
74 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
75 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
76 #, no-wrap
77 msgid "B<#include E<lt>pthread.hE<gt>>\n"
78 msgstr "B<#include E<lt>pthread.hE<gt>>\n"
79
80 #. type: Plain text
81 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
82 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
83 #, no-wrap
84 msgid "B<int pthread_cancel(pthread_t >I<thread>B<);>\n"
85 msgstr "B<int pthread_cancel(pthread_t >I<thread>B<);>\n"
86
87 #. type: SH
88 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
89 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
90 #, no-wrap
91 msgid "DESCRIPTION"
92 msgstr "DESCRIERE"
93
94 #. type: Plain text
95 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
96 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
97 msgid ""
98 "The B<pthread_cancel>() function sends a cancelation request to the thread "
99 "I<thread>. Whether and when the target thread reacts to the cancelation "
100 "request depends on two attributes that are under the control of that thread: "
101 "its cancelability I<state> and I<type>."
102 msgstr ""
103 "Funcția B<pthread_cancel>() trimite o cerere de anulare către firul "
104 "I<thread>. Dacă și când reacționează firul țintă la cererea de anulare "
105 "depinde de două atribute care se află sub controlul firului respectiv: "
106 "capacitatea sa de anulare I<state> și I<type>."
107
108 #. type: Plain text
109 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
110 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
111 msgid ""
112 "A thread's cancelability state, determined by B<pthread_setcancelstate>(3), "
113 "can be I<enabled> (the default for new threads) or I<disabled>. If a thread "
114 "has disabled cancelation, then a cancelation request remains queued until "
115 "the thread enables cancelation. If a thread has enabled cancelation, then "
116 "its cancelability type determines when cancelation occurs."
117 msgstr ""
118 "Starea de anulare a unui fir, determinată de B<pthread_setcancelstate>(3), "
119 "poate fi I<enabled> (implicit pentru firele noi) sau I<disabled>. Dacă un "
120 "fir are anularea dezactivată, atunci o cerere de anulare rămâne în așteptare "
121 "până când firul activează anularea. Dacă un fir a activat anularea, atunci "
122 "tipul său de anulare determină momentul în care are loc anularea."
123
124 #. type: Plain text
125 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
126 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
127 msgid ""
128 "A thread's cancelation type, determined by B<pthread_setcanceltype>(3), may "
129 "be either I<asynchronous> or I<deferred> (the default for new threads). "
130 "Asynchronous cancelability means that the thread can be canceled at any time "
131 "(usually immediately, but the system does not guarantee this). Deferred "
132 "cancelability means that cancelation will be delayed until the thread next "
133 "calls a function that is a I<cancelation point>. A list of functions that "
134 "are or may be cancelation points is provided in B<pthreads>(7)."
135 msgstr ""
136 "Tipul de anulare a unui fir, determinat de B<pthread_setcanceltype>(3), "
137 "poate fi fie I<asincron>, fie I<deferred> (implicit pentru firele noi). "
138 "Anulabilitatea asincronă înseamnă că firul poate fi anulat în orice moment "
139 "(de obicei imediat, dar sistemul nu garantează acest lucru). Capacitatea de "
140 "anulare amânată înseamnă că anularea va fi amânată până când firul va apela "
141 "o funcție care este un I<punct de anulare>. O listă de funcții care sunt sau "
142 "pot fi puncte de anulare este furnizată în B<pthreads>(7)."
143
144 #. type: Plain text
145 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
146 #: opensuse-leap-16-1 opensuse-tumbleweed
147 msgid ""
148 "When a cancelation request is acted on, the following steps occur for "
149 "I<thread> (in this order):"
150 msgstr ""
151 "Atunci când se dă curs unei cereri de anulare, pentru I<thread> au loc "
152 "următoarele etape (în această ordine):"
153
154 #. type: IP
155 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
156 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
157 #, no-wrap
158 msgid "(1)"
159 msgstr "(1)"
160
161 #. type: Plain text
162 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
163 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
164 msgid ""
165 "Cancelation clean-up handlers are popped (in the reverse of the order in "
166 "which they were pushed) and called. (See B<pthread_cleanup_push>(3).)"
167 msgstr ""
168 "Gestionarii de curățare a anulării sunt scoși (în ordinea inversă a ordinii "
169 "în care au fost introduși) și apelați; (a se vedea "
170 "B<pthread_cleanup_push>(3).)"
171
172 #. type: IP
173 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
174 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
175 #, no-wrap
176 msgid "(2)"
177 msgstr "(2)"
178
179 #. type: Plain text
180 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
181 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
182 msgid ""
183 "Thread-specific data destructors are called, in an unspecified order. (See "
184 "B<pthread_key_create>(3).)"
185 msgstr ""
186 "Destructorii de date specifici firelor sunt apelați, într-o ordine "
187 "nespecificată; (a se vedea B<pthread_key_create>(3).)"
188
189 #. type: IP
190 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
191 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
192 #, no-wrap
193 msgid "(3)"
194 msgstr "(3)"
195
196 #. type: Plain text
197 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
198 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
199 msgid "The thread is terminated. (See B<pthread_exit>(3).)"
200 msgstr "Firul este terminat; (a se vedea B<pthread_exit>(3))."
201
202 #. type: Plain text
203 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
204 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
205 msgid ""
206 "The above steps happen asynchronously with respect to the "
207 "B<pthread_cancel>() call; the return status of B<pthread_cancel>() merely "
208 "informs the caller whether the cancelation request was successfully queued."
209 msgstr ""
210 "Etapele de mai sus au loc în mod asincron în ceea ce privește apelul "
211 "B<pthread_cancel>(); starea de retur a apelului B<pthread_cancel>() "
212 "informează doar apelantul dacă cererea de anulare a fost pusă în coadă cu "
213 "succes."
214
215 #. type: Plain text
216 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
217 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
218 msgid ""
219 "After a canceled thread has terminated, a join with that thread using "
220 "B<pthread_join>(3) obtains B<PTHREAD_CANCELED> as the thread's exit "
221 "status. (Joining with a thread is the only way to know that cancelation has "
222 "completed.)"
223 msgstr ""
224 "După terminarea unui fir de execuție anulat, o asociere cu acel fir de "
225 "execuție folosind B<pthread_join>(3) obține B<PTHREAD_CANCELED> ca stare de "
226 "ieșire a firului de execuție; (unirea cu un fir este singura modalitate de a "
227 "ști că anularea s-a încheiat)."
228
229 #. type: SH
230 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
231 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
232 #, no-wrap
233 msgid "RETURN VALUE"
234 msgstr "VALOAREA RETURNATĂ"
235
236 #. type: Plain text
237 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
238 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
239 msgid ""
240 "On success, B<pthread_cancel>() returns 0; on error, it returns a nonzero "
241 "error number."
242 msgstr ""
243 "În caz de succes, B<pthread_cancel>() returnează 0; în caz de eroare, "
244 "returnează un număr de eroare diferit de zero."
245
246 #. type: SH
247 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
248 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
249 #, no-wrap
250 msgid "ERRORS"
251 msgstr "ERORI-IEȘIRE"
252
253 #. type: TP
254 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
255 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
256 #, no-wrap
257 msgid "B<ESRCH>"
258 msgstr "B<ESRCH>"
259
260 #. type: Plain text
261 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
262 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
263 msgid "No thread with the ID I<thread> could be found."
264 msgstr ""
265 "Nu a putut fi găsit niciun fir de execuție cu identificatorul I<thread>."
266
267 #. type: SH
268 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
269 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
270 #, no-wrap
271 msgid "ATTRIBUTES"
272 msgstr "ATRIBUTE"
273
274 #. type: Plain text
275 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
276 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
277 msgid ""
278 "For an explanation of the terms used in this section, see B<attributes>(7)."
279 msgstr ""
280 "Pentru o explicație a termenilor folosiți în această secțiune, a se vedea "
281 "B<attributes>(7)."
282
283 #. type: tbl table
284 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
285 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
286 #, no-wrap
287 msgid "Interface"
288 msgstr "Interfață"
289
290 #. type: tbl table
291 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
292 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
293 #, no-wrap
294 msgid "Attribute"
295 msgstr "Atribut"
296
297 #. type: tbl table
298 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
299 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
300 #, no-wrap
301 msgid "Value"
302 msgstr "Valoare"
303
304 #. type: tbl table
305 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
306 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
307 #, no-wrap
308 msgid ".na\n"
309 msgstr ".na\n"
310
311 #. type: tbl table
312 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
313 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
314 #, no-wrap
315 msgid ".nh\n"
316 msgstr ".nh\n"
317
318 #. type: tbl table
319 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
320 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
321 #, no-wrap
322 msgid "B<pthread_cancel>()"
323 msgstr "B<pthread_cancel>()"
324
325 #. type: tbl table
326 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
327 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
328 #, no-wrap
329 msgid "Thread safety"
330 msgstr "Siguranța firelor"
331
332 #. type: tbl table
333 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
334 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
335 #, no-wrap
336 msgid "MT-Safe"
337 msgstr "MT-Safe"
338
339 #. type: SH
340 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
341 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
342 #, no-wrap
343 msgid "VERSIONS"
344 msgstr "VERSIUNI"
345
346 #. type: Plain text
347 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
348 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
349 msgid ""
350 "On Linux, cancelation is implemented using signals. Under the NPTL "
351 "threading implementation, the first real-time signal (i.e., signal 32) is "
352 "used for this purpose. On LinuxThreads, the second real-time signal is "
353 "used, if real-time signals are available, otherwise B<SIGUSR2> is used."
354 msgstr ""
355 "În Linux, anularea este implementată utilizând semnale. În cadrul "
356 "implementării threading NPTL, primul semnal în timp real (adică semnalul 32) "
357 "este utilizat în acest scop. În LinuxThreads, se utilizează al doilea semnal "
358 "în timp real, dacă sunt disponibile semnale în timp real, altfel se "
359 "utilizează B<SIGUSR2>."
360
361 #. type: SH
362 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
363 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
364 #, no-wrap
365 msgid "STANDARDS"
366 msgstr "STANDARDE"
367
368 #. type: Plain text
369 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
370 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
371 msgid "POSIX.1-2008."
372 msgstr "POSIX.1-2008."
373
374 #. type: SH
375 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
376 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
377 #, no-wrap
378 msgid "HISTORY"
379 msgstr "ISTORIC"
380
381 #. type: Plain text
382 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
383 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
384 msgid "glibc 2.0 POSIX.1-2001."
385 msgstr "glibc 2.0 POSIX.1-2001."
386
387 #. type: SH
388 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
389 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
390 #, no-wrap
391 msgid "EXAMPLES"
392 msgstr "EXEMPLE"
393
394 #. type: Plain text
395 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
396 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
397 msgid ""
398 "The program below creates a thread and then cancels it. The main thread "
399 "joins with the canceled thread to check that its exit status was "
400 "B<PTHREAD_CANCELED>. The following shell session shows what happens when we "
401 "run the program:"
402 msgstr ""
403 "Programul de mai jos creează un fir și apoi îl anulează. Firul principal se "
404 "unește cu firul anulat pentru a verifica dacă starea sa de ieșire a fost "
405 "B<PTHREAD_CANCELED>. Următoarea sesiune shell arată ce se întâmplă atunci "
406 "când rulăm programul:"
407
408 #. type: Plain text
409 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
410 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
411 #, no-wrap
412 msgid ""
413 "$ ./a.out\n"
414 "thread_func(): started; cancelation disabled\n"
415 "main(): sending cancelation request\n"
416 "thread_func(): about to enable cancelation\n"
417 "main(): thread was canceled\n"
418 msgstr ""
419 "$ ./a.out\n"
420 "thread_func(): pornit; anulare dezactivată\n"
421 "main(): se trimite cererea de anulare\n"
422 "thread_func(): privind activarea anulării\n"
423 "main(): firul a fost anulat\n"
424
425 #. type: SS
426 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
427 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
428 #, no-wrap
429 msgid "Program source"
430 msgstr "Sursa programului"
431
432 #. type: Plain text
433 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
434 #: opensuse-tumbleweed
435 #, no-wrap
436 msgid ""
437 "#include E<lt>err.hE<gt>\n"
438 "#include E<lt>pthread.hE<gt>\n"
439 "#include E<lt>stdio.hE<gt>\n"
440 "#include E<lt>stdlib.hE<gt>\n"
441 "#include E<lt>unistd.hE<gt>\n"
442 "\\&\n"
443 "static void *\n"
444 "thread_func(void *ignored_argument)\n"
445 "{\n"
446 " int s;\n"
447 "\\&\n"
448 " /* Disable cancelation for a while, so that we don\\[aq]t\n"
449 " immediately react to a cancelation request. */\n"
450 "\\&\n"
451 " s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
452 " if (s != 0)\n"
453 " errc(EXIT_FAILURE, s, \"pthread_setcancelstate\");\n"
454 "\\&\n"
455 " printf(\"%s(): started; cancelation disabled\\[rs]n\", __func__);\n"
456 " sleep(5);\n"
457 " printf(\"%s(): about to enable cancelation\\[rs]n\", __func__);\n"
458 "\\&\n"
459 " s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
460 " if (s != 0)\n"
461 " errc(EXIT_FAILURE, s, \"pthread_setcancelstate\");\n"
462 "\\&\n"
463 " /* sleep() is a cancelation point. */\n"
464 "\\&\n"
465 " sleep(1000); /* Should get canceled while we sleep */\n"
466 "\\&\n"
467 " /* Should never get here. */\n"
468 "\\&\n"
469 " printf(\"%s(): not canceled!\\[rs]n\", __func__);\n"
470 " return NULL;\n"
471 "}\n"
472 "\\&\n"
473 "int\n"
474 "main(void)\n"
475 "{\n"
476 " pthread_t thr;\n"
477 " void *res;\n"
478 " int s;\n"
479 "\\&\n"
480 " /* Start a thread and then send it a cancelation request. */\n"
481 "\\&\n"
482 " s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
483 " if (s != 0)\n"
484 " errc(EXIT_FAILURE, s, \"pthread_create\");\n"
485 "\\&\n"
486 " sleep(2); /* Give thread a chance to get started */\n"
487 "\\&\n"
488 " printf(\"%s(): sending cancelation request\\[rs]n\", __func__);\n"
489 " s = pthread_cancel(thr);\n"
490 " if (s != 0)\n"
491 " errc(EXIT_FAILURE, s, \"pthread_cancel\");\n"
492 "\\&\n"
493 " /* Join with thread to see what its exit status was. */\n"
494 "\\&\n"
495 " s = pthread_join(thr, &res);\n"
496 " if (s != 0)\n"
497 " errc(EXIT_FAILURE, s, \"pthread_join\");\n"
498 "\\&\n"
499 " if (res == PTHREAD_CANCELED)\n"
500 " printf(\"%s(): thread was canceled\\[rs]n\", __func__);\n"
501 " else\n"
502 " printf(\"%s(): thread wasn\\[aq]t canceled (shouldn\\[aq]t happen!)\\[rs]n\",\n"
503 " __func__);\n"
504 " exit(EXIT_SUCCESS);\n"
505 "}\n"
506 msgstr ""
507 "#include E<lt>err.hE<gt>\n"
508 "#include E<lt>pthread.hE<gt>\n"
509 "#include E<lt>stdio.hE<gt>\n"
510 "#include E<lt>stdlib.hE<gt>\n"
511 "#include E<lt>unistd.hE<gt>\n"
512 "\\&\n"
513 "#define handle_error_en(en, msg) \\[rs]\n"
514 " do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n"
515 "\\&\n"
516 "static void *\n"
517 "thread_func(void *ignored_argument)\n"
518 "{\n"
519 " int s;\n"
520 "\\&\n"
521 " /* Dezactivează anularea pentru o perioadă, astfel încât\n"
522 " să nu reacționăm imediat la o cerere de anulare. */\n"
523 "\\&\n"
524 " s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
525 " if (s != 0)\n"
526 " errc(EXIT_FAILURE, s, \"pthread_setcancelstate\");\n"
527 "\\&\n"
528 " printf(\"%s(): pornit; anulare dezactivată\\[rs]n\", __func__);\n"
529 " sleep(5);\n"
530 " printf(\"%s(): privind activarea anulării\\[rs]n\", __func__);\n"
531 "\\&\n"
532 " s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
533 " if (s != 0)\n"
534 " errc(EXIT_FAILURE, s, \"pthread_setcancelstate\");\n"
535 "\\&\n"
536 " /* sleep() este un punct de anulare. */\n"
537 "\\&\n"
538 " sleep(1000); /* Ar trebui să se anuleze în timp ce dormim */\n"
539 "\\&\n"
540 " /* N-ar trebui să ajungă niciodată aici. */\n"
541 "\\&\n"
542 " printf(\"%s(): nu este anulat!\\[rs]n\", __func__);\n"
543 " return NULL;\n"
544 "}\n"
545 "\\&\n"
546 "int\n"
547 "main(void)\n"
548 "{\n"
549 " pthread_t thr;\n"
550 " void *res;\n"
551 " int s;\n"
552 "\\&\n"
553 " /* Începe un fir și apoi îi trimite o cerere de anulare. */\n"
554 "\\&\n"
555 " s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
556 " if (s != 0)\n"
557 " errc(EXIT_FAILURE, s, \"pthread_create\");\n"
558 "\\&\n"
559 " sleep(2); /* Dă firului o șansă de a începe */\n"
560 "\\&\n"
561 " printf(\"%s(): se trimite cererea de anulare\\[rs]n\", __func__);\n"
562 " s = pthread_cancel(thr);\n"
563 " if (s != 0)\n"
564 " errc(EXIT_FAILURE, s, \"pthread_cancel\");\n"
565 "\\&\n"
566 " /* Se alătură firului pentru a vedea care a fost starea sa de ieșire. */\n"
567 "\\&\n"
568 " s = pthread_join(thr, &res);\n"
569 " if (s != 0)\n"
570 " errc(EXIT_FAILURE, s, \"pthread_join\");\n"
571 "\\&\n"
572 " if (res == PTHREAD_CANCELED)\n"
573 " printf(\"%s(): firul a fost anulat\\[rs]n\", __func__);\n"
574 " else\n"
575 " printf(\"%s(): firul nu a fost anulat (nu ar trebui să se întâmple!)\\[rs]n\",\n"
576 " __func__);\n"
577 " exit(EXIT_SUCCESS);\n"
578 "}\n"
579
580 #. SRC END
581 #. type: SH
582 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
583 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
584 #, no-wrap
585 msgid "SEE ALSO"
586 msgstr "CONSULTAȚI ȘI"
587
588 #. type: Plain text
589 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
590 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
591 msgid ""
592 "B<pthread_cleanup_push>(3), B<pthread_create>(3), B<pthread_exit>(3), "
593 "B<pthread_join>(3), B<pthread_key_create>(3), B<pthread_setcancelstate>(3), "
594 "B<pthread_setcanceltype>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
595 msgstr ""
596 "B<pthread_cleanup_push>(3), B<pthread_create>(3), B<pthread_exit>(3), "
597 "B<pthread_join>(3), B<pthread_key_create>(3), B<pthread_setcancelstate>(3), "
598 "B<pthread_setcanceltype>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
599
600 #. type: TH
601 #: debian-trixie
602 #, no-wrap
603 msgid "2024-06-15"
604 msgstr "15 iunie 2024"
605
606 #. type: TH
607 #: debian-trixie
608 #, no-wrap
609 msgid "Linux man-pages 6.9.1"
610 msgstr "Pagini de manual de Linux 6.9.1"
611
612 #. type: Plain text
613 #: debian-trixie
614 msgid "POSIX threads library (I<libpthread>, I<-lpthread>)"
615 msgstr "Biblioteca de fire de execuție POSIX (I<libpthread>, I<-lpthread>)"
616
617 #. type: Plain text
618 #: debian-trixie
619 msgid ""
620 "When a cancelation requested is acted on, the following steps occur for "
621 "I<thread> (in this order):"
622 msgstr ""
623 "Atunci când se dă curs unei cereri de anulare, pentru I<thread> au loc "
624 "următoarele etape (în această ordine):"
625
626 #. type: Plain text
627 #: debian-trixie fedora-44 fedora-rawhide
628 #, no-wrap
629 msgid ""
630 "#include E<lt>errno.hE<gt>\n"
631 "#include E<lt>pthread.hE<gt>\n"
632 "#include E<lt>stdio.hE<gt>\n"
633 "#include E<lt>stdlib.hE<gt>\n"
634 "#include E<lt>unistd.hE<gt>\n"
635 "\\&\n"
636 "#define handle_error_en(en, msg) \\[rs]\n"
637 " do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n"
638 "\\&\n"
639 "static void *\n"
640 "thread_func(void *ignored_argument)\n"
641 "{\n"
642 " int s;\n"
643 "\\&\n"
644 " /* Disable cancelation for a while, so that we don\\[aq]t\n"
645 " immediately react to a cancelation request. */\n"
646 "\\&\n"
647 " s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
648 " if (s != 0)\n"
649 " handle_error_en(s, \"pthread_setcancelstate\");\n"
650 "\\&\n"
651 " printf(\"%s(): started; cancelation disabled\\[rs]n\", __func__);\n"
652 " sleep(5);\n"
653 " printf(\"%s(): about to enable cancelation\\[rs]n\", __func__);\n"
654 "\\&\n"
655 " s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
656 " if (s != 0)\n"
657 " handle_error_en(s, \"pthread_setcancelstate\");\n"
658 "\\&\n"
659 " /* sleep() is a cancelation point. */\n"
660 "\\&\n"
661 " sleep(1000); /* Should get canceled while we sleep */\n"
662 "\\&\n"
663 " /* Should never get here. */\n"
664 "\\&\n"
665 " printf(\"%s(): not canceled!\\[rs]n\", __func__);\n"
666 " return NULL;\n"
667 "}\n"
668 "\\&\n"
669 "int\n"
670 "main(void)\n"
671 "{\n"
672 " pthread_t thr;\n"
673 " void *res;\n"
674 " int s;\n"
675 "\\&\n"
676 " /* Start a thread and then send it a cancelation request. */\n"
677 "\\&\n"
678 " s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
679 " if (s != 0)\n"
680 " handle_error_en(s, \"pthread_create\");\n"
681 "\\&\n"
682 " sleep(2); /* Give thread a chance to get started */\n"
683 "\\&\n"
684 " printf(\"%s(): sending cancelation request\\[rs]n\", __func__);\n"
685 " s = pthread_cancel(thr);\n"
686 " if (s != 0)\n"
687 " handle_error_en(s, \"pthread_cancel\");\n"
688 "\\&\n"
689 " /* Join with thread to see what its exit status was. */\n"
690 "\\&\n"
691 " s = pthread_join(thr, &res);\n"
692 " if (s != 0)\n"
693 " handle_error_en(s, \"pthread_join\");\n"
694 "\\&\n"
695 " if (res == PTHREAD_CANCELED)\n"
696 " printf(\"%s(): thread was canceled\\[rs]n\", __func__);\n"
697 " else\n"
698 " printf(\"%s(): thread wasn\\[aq]t canceled (shouldn\\[aq]t happen!)\\[rs]n\",\n"
699 " __func__);\n"
700 " exit(EXIT_SUCCESS);\n"
701 "}\n"
702 msgstr ""
703 "#include E<lt>errno.hE<gt>\n"
704 "#include E<lt>pthread.hE<gt>\n"
705 "#include E<lt>stdio.hE<gt>\n"
706 "#include E<lt>stdlib.hE<gt>\n"
707 "#include E<lt>unistd.hE<gt>\n"
708 "\\&\n"
709 "#define handle_error_en(en, msg) \\[rs]\n"
710 " do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n"
711 "\\&\n"
712 "static void *\n"
713 "thread_func(void *ignored_argument)\n"
714 "{\n"
715 " int s;\n"
716 "\\&\n"
717 " /* Dezactivează anularea pentru o perioadă, astfel încât\n"
718 " să nu reacționăm imediat la o cerere de anulare. */\n"
719 "\\&\n"
720 " s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
721 " if (s != 0)\n"
722 " handle_error_en(s, \"pthread_setcancelstate\");\n"
723 "\\&\n"
724 " printf(\"%s(): pornit; anulare dezactivată\\[rs]n\", __func__);\n"
725 " sleep(5);\n"
726 " printf(\"%s(): privind activarea anulării\\[rs]n\", __func__);\n"
727 "\\&\n"
728 " s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
729 " if (s != 0)\n"
730 " handle_error_en(s, \"pthread_setcancelstate\");\n"
731 "\\&\n"
732 " /* sleep() este un punct de anulare. */\n"
733 "\\&\n"
734 " sleep(1000); /* Ar trebui să se anuleze în timp ce dormim */\n"
735 "\\&\n"
736 " /* N-ar trebui să ajungă niciodată aici. */\n"
737 "\\&\n"
738 " printf(\"%s(): nu este anulat!\\[rs]n\", __func__);\n"
739 " return NULL;\n"
740 "}\n"
741 "\\&\n"
742 "int\n"
743 "main(void)\n"
744 "{\n"
745 " pthread_t thr;\n"
746 " void *res;\n"
747 " int s;\n"
748 "\\&\n"
749 " /* Începe un fir și apoi îi trimite o cerere de anulare. */\n"
750 "\\&\n"
751 " s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
752 " if (s != 0)\n"
753 " handle_error_en(s, \"pthread_create\");\n"
754 "\\&\n"
755 " sleep(2); /* Dă firului o șansă de a începe */\n"
756 "\\&\n"
757 " printf(\"%s(): se trimite cererea de anulare\\[rs]n\", __func__);\n"
758 " s = pthread_cancel(thr);\n"
759 " if (s != 0)\n"
760 " handle_error_en(s, \"pthread_cancel\");\n"
761 "\\&\n"
762 " /* Se alătură firului pentru a vedea care a fost starea sa de ieșire. */\n"
763 "\\&\n"
764 " s = pthread_join(thr, &res);\n"
765 " if (s != 0)\n"
766 " handle_error_en(s, \"pthread_join\");\n"
767 "\\&\n"
768 " if (res == PTHREAD_CANCELED)\n"
769 " printf(\"%s(): firul a fost anulat\\[rs]n\", __func__);\n"
770 " else\n"
771 " printf(\"%s(): firul nu a fost anulat (nu ar trebui să se întâmple!)\\[rs]n\",\n"
772 " __func__);\n"
773 " exit(EXIT_SUCCESS);\n"
774 "}\n"
775
776 #. type: TH
777 #: fedora-44 fedora-rawhide
778 #, no-wrap
779 msgid "2024-11-05"
780 msgstr "5 noiembrie 2024"
781
782 #. type: TH
783 #: fedora-44 fedora-rawhide
784 #, no-wrap
785 msgid "Linux man-pages 6.13"
786 msgstr "Pagini de manual de Linux 6.13"
787
788 #. type: TH
789 #: mageia-cauldron
790 #, no-wrap
791 msgid "Linux man-pages 6.17"
792 msgstr "Pagini de manual de Linux 6.17"
793
794 #. type: TH
795 #: opensuse-leap-16-1 opensuse-tumbleweed
796 #, no-wrap
797 msgid "Linux man-pages (unreleased)"
798 msgstr "Pagini de manual Linux (nepublicate)"