Debian Codegraph @

po/ar/man3/pthread_cleanup_push.3.po

raw
1 # Arabic translation of manpages
2 # This file is distributed under the same license as the manpages-l10n package.
3 # Copyright © of this file:
4 # زايد السعيدي <[email protected]>, 2026.
5 msgid ""
6 msgstr ""
7 "Project-Id-Version: manpages-l10n 4.30.2\n"
8 "POT-Creation-Date: 2026-06-05 06:38+0200\n"
9 "PO-Revision-Date: 2026-06-02 19:37+0400\n"
10 "Last-Translator: Zayed Al-Saidi <[email protected]>\n"
11 "Language-Team: Arabic <[email protected]>\n"
12 "Language: ar\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=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 "
17 "&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"
18 "X-Generator: Lokalize 23.08.5\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_cleanup_push"
25 msgstr "pthread_cleanup_push"
26
27 #. type: TH
28 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
29 #: opensuse-tumbleweed
30 #, no-wrap
31 msgid "2025-08-20"
32 msgstr "20 أغسطس 2025"
33
34 #. type: TH
35 #: archlinux debian-unstable
36 #, no-wrap
37 msgid "Linux man-pages 6.18"
38 msgstr "صفحات دليل لينكس 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 "الاسم"
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 ""
51 "pthread_cleanup_push, pthread_cleanup_pop - push and pop thread cancelation "
52 "clean-up handlers"
53 msgstr ""
54 "pthread_cleanup_push, pthread_cleanup_pop - دفع وسحب معالجات تنظيف إلغاء "
55 "الخيط"
56
57 #. type: SH
58 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
59 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
60 #, no-wrap
61 msgid "LIBRARY"
62 msgstr "المكتبة"
63
64 #. type: Plain text
65 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
66 #: opensuse-leap-16-1 opensuse-tumbleweed
67 msgid "POSIX threads library (I<libpthread>,\\ I<-lpthread>)"
68 msgstr "مكتبة مسالك POSIX (I<libpthread>،\\ I<-lpthread>)"
69
70 #. type: SH
71 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
72 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
73 #, no-wrap
74 msgid "SYNOPSIS"
75 msgstr "موجز"
76
77 #. type: Plain text
78 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
79 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
80 #, no-wrap
81 msgid "B<#include E<lt>pthread.hE<gt>>\n"
82 msgstr "B<#include E<lt>pthread.hE<gt>>\n"
83
84 #. type: Plain text
85 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
86 #: opensuse-leap-16-1 opensuse-tumbleweed
87 #, no-wrap
88 msgid ""
89 "B<void pthread_cleanup_push(typeof(void (void *)) *>I<routine>B<, void *>I<arg>B<);>\n"
90 "B<void pthread_cleanup_pop(int >I<execute>B<);>\n"
91 msgstr ""
92 "B<void pthread_cleanup_push(typeof(void (void *)) *>I<routine>B<, void *>I<arg>B<);>\n"
93 "B<void pthread_cleanup_pop(int >I<execute>B<);>\n"
94
95 #. type: SH
96 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
97 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
98 #, no-wrap
99 msgid "DESCRIPTION"
100 msgstr "الوصف"
101
102 #. type: Plain text
103 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
104 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
105 msgid ""
106 "These functions manipulate the calling thread's stack of thread-cancelation "
107 "clean-up handlers. A clean-up handler is a function that is automatically "
108 "executed when a thread is canceled (or in various other circumstances "
109 "described below); it might, for example, unlock a mutex so that it becomes "
110 "available to other threads in the process."
111 msgstr ""
112 "تتعامل هذه الدوال مع كومة معالجات تنظيف إلغاء الخيط للخيط المستدعي. معالج "
113 "التنظيف هو دالة تُنفذ آليًا عند إلغاء خيط (أو في ظروف أخرى متنوعة موصوفة "
114 "أدناه)؛ قد يقوم، على سبيل المثال، بفتح قفل كائن المزامنة (mutex) ليصبح متاحًا "
115 "لخيوط أخرى في العملية."
116
117 #. type: Plain text
118 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
119 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
120 msgid ""
121 "The B<pthread_cleanup_push>() function pushes I<routine> onto the top of "
122 "the stack of clean-up handlers. When I<routine> is later invoked, it will "
123 "be given I<arg> as its argument."
124 msgstr ""
125 "تدفع الدالة B<pthread_cleanup_push>() الروتين I<routine> إلى أعلى كومة "
126 "معالجات التنظيف. عندما يُستدعى I<routine> لاحقًا، سيُعطى I<arg> كمعامل له."
127
128 #. type: Plain text
129 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
130 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
131 msgid ""
132 "The B<pthread_cleanup_pop>() function removes the routine at the top of the "
133 "stack of clean-up handlers, and optionally executes it if I<execute> is "
134 "nonzero."
135 msgstr ""
136 "تزيل الدالة B<pthread_cleanup_pop>() الروتين الموجود في أعلى كومة معالجات "
137 "التنظيف، وتنفذه اختياريًا إذا كان I<execute> غير صفري."
138
139 #. type: Plain text
140 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
141 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
142 msgid ""
143 "A cancelation clean-up handler is popped from the stack and executed in the "
144 "following circumstances:"
145 msgstr "يُسحب معالج تنظيف الإلغاء من الكومة ويُنفذ في الظروف التالية:"
146
147 #. type: IP
148 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
149 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
150 #, no-wrap
151 msgid "\\[bu]"
152 msgstr "\\[bu]"
153
154 #. type: Plain text
155 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
156 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
157 msgid ""
158 "When a thread is canceled, all of the stacked clean-up handlers are popped "
159 "and executed in the reverse of the order in which they were pushed onto the "
160 "stack."
161 msgstr ""
162 "عند إلغاء خيط، تُسحب جميع معالجات التنظيف المكدسة وتُنفذ بترتيب عكسي للترتيب "
163 "الذي دُفعت به إلى الكومة."
164
165 #. type: Plain text
166 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
167 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
168 msgid ""
169 "When a thread terminates by calling B<pthread_exit>(3), all clean-up "
170 "handlers are executed as described in the preceding point. (Clean-up "
171 "handlers are I<not> called if the thread terminates by performing a "
172 "I<return> from the thread start function.)"
173 msgstr ""
174 "عند إنهاء خيط باستدعاء B<pthread_exit>(3)، تُنفذ جميع معالجات التنظيف كما هو "
175 "موصوف في النقطة السابقة. (لا تُستدعى معالجات التنظيف إذا أنهى الخيط بتنفيذ "
176 "I<return> من دالة بدء الخيط.)"
177
178 #. type: Plain text
179 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
180 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
181 msgid ""
182 "When a thread calls B<pthread_cleanup_pop>() with a nonzero I<execute> "
183 "argument, the top-most clean-up handler is popped and executed."
184 msgstr ""
185 "عندما يستدعي خيط B<pthread_cleanup_pop>() بمعامل I<execute> غير صفري، يُسحب "
186 "معالج التنظيف الأعلى ويُنفذ."
187
188 #. type: Plain text
189 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
190 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
191 msgid ""
192 "POSIX.1 permits B<pthread_cleanup_push>() and B<pthread_cleanup_pop>() to "
193 "be implemented as macros that expand to text containing \\[aq]B<{>\\[aq] and "
194 "\\[aq]B<}>\\[aq], respectively. For this reason, the caller must ensure "
195 "that calls to these functions are paired within the same function, and at "
196 "the same lexical nesting level. (In other words, a clean-up handler is "
197 "established only during the execution of a specified section of code.)"
198 msgstr ""
199 "يسمح POSIX.1 بتنفيذ B<pthread_cleanup_push>() و B<pthread_cleanup_pop>() "
200 "كوحدات ماكرو تتوسع إلى نص يحتوي على \\[aq]B<{>\\[aq] و \\[aq]B<}>\\[aq]، على "
201 "التوالي. لهذا السبب، يجب على المستدعي ضمان أن استدعاءات هذه الدوال مقترنة "
202 "داخل نفس الدالة، وعلى نفس مستوى التداخل المعجمي. (بمعنى آخر، يُنشأ معالج "
203 "التنظيف فقط أثناء تنفيذ قسم محدد من الكود.)"
204
205 #. type: Plain text
206 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
207 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
208 msgid ""
209 "Calling B<longjmp>(3) (B<siglongjmp>(3)) produces undefined results if any "
210 "call has been made to B<pthread_cleanup_push>() or "
211 "B<pthread_cleanup_pop>() without the matching call of the pair since the "
212 "jump buffer was filled by B<setjmp>(3) (B<sigsetjmp>(3)). Likewise, "
213 "calling B<longjmp>(3) (B<siglongjmp>(3)) from inside a clean-up handler "
214 "produces undefined results unless the jump buffer was also filled by "
215 "B<setjmp>(3) (B<sigsetjmp>(3)) inside the handler."
216 msgstr ""
217 "استدعاء B<longjmp>(3) (B<siglongjmp>(3)) يُنتج نتائج غير محددة إذا تم أي "
218 "استدعاء لـ B<pthread_cleanup_push>() أو B<pthread_cleanup_pop>() دون "
219 "الاستدعاء المطابق للزوج منذ أن مُلئ مخزن القفز بواسطة B<setjmp>(3) "
220 "(B<sigsetjmp>(3)). وبالمثل، استدعاء B<longjmp>(3) (B<siglongjmp>(3)) من داخل "
221 "معالج تنظيف يُنتج نتائج غير محددة ما لم يُملأ مخزن القفز أيضًا بواسطة "
222 "B<setjmp>(3) (B<sigsetjmp>(3)) داخل المعالج."
223
224 #. type: SH
225 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
226 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
227 #, no-wrap
228 msgid "RETURN VALUE"
229 msgstr "قيمة الإرجاع"
230
231 #. type: Plain text
232 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
233 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
234 msgid "These functions do not return a value."
235 msgstr "لا تعيد هذه الدوال قيمة."
236
237 #. type: SH
238 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
239 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
240 #, no-wrap
241 msgid "ERRORS"
242 msgstr "الأخطاء"
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 msgid "There are no errors."
248 msgstr "لا توجد أخطاء."
249
250 #. type: SH
251 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
252 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
253 #, no-wrap
254 msgid "ATTRIBUTES"
255 msgstr "السمات"
256
257 #. type: Plain text
258 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
259 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
260 msgid ""
261 "For an explanation of the terms used in this section, see B<attributes>(7)."
262 msgstr ""
263 "للاطلاع على شرح للمصطلحات المستخدمة في هذا القسم، انظر B<attributes>(7)."
264
265 #. type: tbl table
266 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
267 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
268 #, no-wrap
269 msgid "Interface"
270 msgstr "الواجهة"
271
272 #. type: tbl table
273 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
274 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
275 #, no-wrap
276 msgid "Attribute"
277 msgstr "السمة"
278
279 #. type: tbl table
280 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
281 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
282 #, no-wrap
283 msgid "Value"
284 msgstr "القيمة"
285
286 #. type: tbl table
287 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
288 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
289 #, no-wrap
290 msgid ".na\n"
291 msgstr ".na\n"
292
293 #. type: tbl table
294 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
295 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
296 #, no-wrap
297 msgid ".nh\n"
298 msgstr ".nh\n"
299
300 #. type: tbl table
301 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
302 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
303 #, no-wrap
304 msgid ""
305 "B<pthread_cleanup_push>(),\n"
306 "B<pthread_cleanup_pop>()"
307 msgstr ""
308 "B<pthread_cleanup_push>(),\n"
309 "B<pthread_cleanup_pop>()"
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 "Thread safety"
316 msgstr "سلامة الخيوط"
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 "MT-Safe"
323 msgstr "MT-Safe"
324
325 #. type: SH
326 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
327 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
328 #, no-wrap
329 msgid "VERSIONS"
330 msgstr "الإصدارات"
331
332 #. type: Plain text
333 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
334 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
335 msgid ""
336 "On glibc, the B<pthread_cleanup_push>() and B<pthread_cleanup_pop>() "
337 "functions I<are> implemented as macros that expand to text containing "
338 "\\[aq]B<{>\\[aq] and \\[aq]B<}>\\[aq], respectively. This means that "
339 "variables declared within the scope of paired calls to these functions will "
340 "be visible within only that scope."
341 msgstr ""
342 "في glibc، الدالتان B<pthread_cleanup_push>() و B<pthread_cleanup_pop>() "
343 "I<هما> منفذتان كوحدات ماكرو تتوسع إلى نص يحتوي على \\[aq]B<{>\\[aq] و "
344 "\\[aq]B<}>\\[aq]، على التوالي. هذا يعني أن المتغيرات المعلنة ضمن نطاق "
345 "الاستدعاءات المقترنة لهذه الدوال ستكون مرئية فقط ضمن ذلك النطاق."
346
347 #. The text was actually added in the 2004 TC2
348 #. type: Plain text
349 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
350 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
351 msgid ""
352 "POSIX.1 says that the effect of using I<return>, I<break>, I<continue>, or "
353 "I<goto> to prematurely leave a block bracketed B<pthread_cleanup_push>() "
354 "and B<pthread_cleanup_pop>() is undefined. Portable applications should "
355 "avoid doing this."
356 msgstr ""
357 "يقول POSIX.1 أن تأثير استخدام I<return> أو I<break> أو I<continue> أو "
358 "I<goto> لمغادرة كتلة محصورة بين B<pthread_cleanup_push>() و "
359 "B<pthread_cleanup_pop>() مبكرًا هو غير محدد. يجب على التطبيقات المحمولة تجنب "
360 "فعل ذلك."
361
362 #. type: SH
363 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
364 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
365 #, no-wrap
366 msgid "STANDARDS"
367 msgstr "المعايير"
368
369 #. type: Plain text
370 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
371 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
372 msgid "POSIX.1-2008."
373 msgstr "POSIX.1-2008."
374
375 #. type: SH
376 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
377 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
378 #, no-wrap
379 msgid "HISTORY"
380 msgstr "التاريخ"
381
382 #. type: Plain text
383 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
384 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
385 msgid "POSIX.1-2001. glibc 2.0."
386 msgstr "POSIX.1-2001. glibc 2.0."
387
388 #. type: SH
389 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
390 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
391 #, no-wrap
392 msgid "EXAMPLES"
393 msgstr "أمثلة"
394
395 #. type: Plain text
396 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
397 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
398 msgid ""
399 "The program below provides a simple example of the use of the functions "
400 "described in this page. The program creates a thread that executes a loop "
401 "bracketed by B<pthread_cleanup_push>() and B<pthread_cleanup_pop>(). This "
402 "loop increments a global variable, I<cnt>, once each second. Depending on "
403 "what command-line arguments are supplied, the main thread sends the other "
404 "thread a cancelation request, or sets a global variable that causes the "
405 "other thread to exit its loop and terminate normally (by doing a I<return>)."
406 msgstr ""
407 "يقدم البرنامج أدناه مثالًا بسيطًا لاستخدام الدوال الموصوفة في هذه الصفحة. ينشئ "
408 "البرنامج خيطًا ينفذ حلقة محصورة بين B<pthread_cleanup_push>() و "
409 "B<pthread_cleanup_pop>(). تزيد هذه الحلقة متغيرًا عامًا، I<cnt>، مرة كل ثانية. "
410 "اعتمادًا على وسائط سطر الأوامر المقدمة، يرسل الخيط الرئيسي للخيط الآخر طلب "
411 "إلغاء، أو يضبط متغيرًا عامًا يتسبب في خروج الخيط الآخر من حلقته وإنهائه بشكل "
412 "طبيعي (عن طريق تنفيذ I<return>)."
413
414 #. type: Plain text
415 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
416 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
417 msgid ""
418 "In the following shell session, the main thread sends a cancelation request "
419 "to the other thread:"
420 msgstr "في جلسة الصدفة التالية، يرسل الخيط الرئيسي طلب إلغاء إلى الخيط الآخر:"
421
422 #. type: Plain text
423 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
424 #: opensuse-tumbleweed
425 #, no-wrap
426 msgid ""
427 "$B< ./a.out>;\n"
428 "New thread started\n"
429 "cnt = 0\n"
430 "cnt = 1\n"
431 "Canceling thread\n"
432 "Called clean-up handler\n"
433 "Thread was canceled; cnt = 0\n"
434 msgstr ""
435 "$B< ./a.out>;\n"
436 "New thread started\n"
437 "cnt = 0\n"
438 "cnt = 1\n"
439 "Canceling thread\n"
440 "Called clean-up handler\n"
441 "Thread was canceled; cnt = 0\n"
442
443 #. type: Plain text
444 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
445 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
446 msgid ""
447 "From the above, we see that the thread was canceled, and that the "
448 "cancelation clean-up handler was called and it reset the value of the global "
449 "variable I<cnt> to 0."
450 msgstr ""
451 "مما سبق، نرى أن الخيط أُلغي، وأن معالج تنظيف الإلغاء استُدعي وأعاد ضبط قيمة "
452 "المتغير العام I<cnt> إلى 0."
453
454 #. type: Plain text
455 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
456 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
457 msgid ""
458 "In the next run, the main program sets a global variable that causes other "
459 "thread to terminate normally:"
460 msgstr ""
461 "في التشغيل التالي، يضبط البرنامج الرئيس متغيرًا عامًا يتسبب في إنهاء الخيط "
462 "الآخر بشكل طبيعي:"
463
464 #. type: Plain text
465 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
466 #: opensuse-tumbleweed
467 #, no-wrap
468 msgid ""
469 "$B< ./a.out x>;\n"
470 "New thread started\n"
471 "cnt = 0\n"
472 "cnt = 1\n"
473 "Thread terminated normally; cnt = 2\n"
474 msgstr ""
475 "$B< ./a.out x>;\n"
476 "New thread started\n"
477 "cnt = 0\n"
478 "cnt = 1\n"
479 "Thread terminated normally; cnt = 2\n"
480
481 #. type: Plain text
482 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
483 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
484 msgid ""
485 "From the above, we see that the clean-up handler was not executed (because "
486 "I<cleanup_pop_arg> was 0), and therefore the value of I<cnt> was not reset."
487 msgstr ""
488 "مما سبق، نرى أن معالج التنظيف لم يُنفذ (لأن I<cleanup_pop_arg> كانت 0)، "
489 "وبالتالي لم تُعد قيمة I<cnt>."
490
491 #. type: Plain text
492 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
493 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
494 msgid ""
495 "In the next run, the main program sets a global variable that causes the "
496 "other thread to terminate normally, and supplies a nonzero value for "
497 "I<cleanup_pop_arg>:"
498 msgstr ""
499 "في التشغيل التالي، يضبط البرنامج الرئيس متغيرًا عامًا يتسبب في إنهاء الخيط "
500 "الآخر بشكل طبيعي، ويوفر قيمة غير صفرية لـ I<cleanup_pop_arg>:"
501
502 #. type: Plain text
503 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
504 #: opensuse-tumbleweed
505 #, no-wrap
506 msgid ""
507 "$B< ./a.out x 1>;\n"
508 "New thread started\n"
509 "cnt = 0\n"
510 "cnt = 1\n"
511 "Called clean-up handler\n"
512 "Thread terminated normally; cnt = 0\n"
513 msgstr ""
514 "$B< ./a.out x 1>;\n"
515 "New thread started\n"
516 "cnt = 0\n"
517 "cnt = 1\n"
518 "Called clean-up handler\n"
519 "Thread terminated normally; cnt = 0\n"
520
521 #. type: Plain text
522 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
523 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
524 msgid ""
525 "In the above, we see that although the thread was not canceled, the clean-up "
526 "handler was executed, because the argument given to "
527 "B<pthread_cleanup_pop>() was nonzero."
528 msgstr ""
529 "في المثال أعلاه، نرى أنه على الرغم من أن الخيط لم يُلغَ، فقد نُفذ معالج "
530 "التنظيف، لأن الوسيط المُعطى لـ B<pthread_cleanup_pop>() كان غير صفري."
531
532 #. type: SS
533 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
534 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
535 #, no-wrap
536 msgid "Program source"
537 msgstr "مصدر البرنامج"
538
539 #. type: Plain text
540 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
541 #: opensuse-tumbleweed
542 #, no-wrap
543 msgid ""
544 "#include E<lt>err.hE<gt>\n"
545 "#include E<lt>errno.hE<gt>\n"
546 "#include E<lt>pthread.hE<gt>\n"
547 "#include E<lt>stdio.hE<gt>\n"
548 "#include E<lt>stdlib.hE<gt>\n"
549 "#include E<lt>sys/types.hE<gt>\n"
550 "#include E<lt>unistd.hE<gt>\n"
551 "\\&\n"
552 "static int done = 0;\n"
553 "static int cleanup_pop_arg = 0;\n"
554 "static int cnt = 0;\n"
555 "\\&\n"
556 "static void\n"
557 "cleanup_handler(void *arg)\n"
558 "{\n"
559 " printf(\"Called clean-up handler\\[rs]n\");\n"
560 " cnt = 0;\n"
561 "}\n"
562 "\\&\n"
563 "static void *\n"
564 "thread_start(void *arg)\n"
565 "{\n"
566 " time_t curr;\n"
567 "\\&\n"
568 " printf(\"New thread started\\[rs]n\");\n"
569 "\\&\n"
570 " pthread_cleanup_push(cleanup_handler, NULL);\n"
571 "\\&\n"
572 " curr = time(NULL);\n"
573 "\\&\n"
574 " while (!done) {\n"
575 " pthread_testcancel(); /* A cancelation point */\n"
576 " if (curr E<lt> time(NULL)) {\n"
577 " curr = time(NULL);\n"
578 " printf(\"cnt = %d\\[rs]n\", cnt); /* A cancelation point */\n"
579 " cnt++;\n"
580 " }\n"
581 " }\n"
582 "\\&\n"
583 " pthread_cleanup_pop(cleanup_pop_arg);\n"
584 " return NULL;\n"
585 "}\n"
586 "\\&\n"
587 "int\n"
588 "main(int argc, char *argv[])\n"
589 "{\n"
590 " pthread_t thr;\n"
591 " int s;\n"
592 " void *res;\n"
593 "\\&\n"
594 " s = pthread_create(&thr, NULL, thread_start, NULL);\n"
595 " if (s != 0)\n"
596 " errc(EXIT_FAILURE, s, \"pthread_create\");\n"
597 "\\&\n"
598 " sleep(2); /* Allow new thread to run a while */\n"
599 "\\&\n"
600 " if (argc E<gt> 1) {\n"
601 " if (argc E<gt> 2)\n"
602 " cleanup_pop_arg = atoi(argv[2]);\n"
603 " done = 1;\n"
604 "\\&\n"
605 " } else {\n"
606 " printf(\"Canceling thread\\[rs]n\");\n"
607 " s = pthread_cancel(thr);\n"
608 " if (s != 0)\n"
609 " errc(EXIT_FAILURE, s, \"pthread_cancel\");\n"
610 " }\n"
611 "\\&\n"
612 " s = pthread_join(thr, &res);\n"
613 " if (s != 0)\n"
614 " errc(EXIT_FAILURE, s, \"pthread_join\");\n"
615 "\\&\n"
616 " if (res == PTHREAD_CANCELED)\n"
617 " printf(\"Thread was canceled; cnt = %d\\[rs]n\", cnt);\n"
618 " else\n"
619 " printf(\"Thread terminated normally; cnt = %d\\[rs]n\", cnt);\n"
620 " exit(EXIT_SUCCESS);\n"
621 "}\n"
622 msgstr ""
623 "#include E<lt>err.hE<gt>\n"
624 "#include E<lt>errno.hE<gt>\n"
625 "#include E<lt>pthread.hE<gt>\n"
626 "#include E<lt>stdio.hE<gt>\n"
627 "#include E<lt>stdlib.hE<gt>\n"
628 "#include E<lt>sys/types.hE<gt>\n"
629 "#include E<lt>unistd.hE<gt>\n"
630 "\\&\n"
631 "static int done = 0;\n"
632 "static int cleanup_pop_arg = 0;\n"
633 "static int cnt = 0;\n"
634 "\\&\n"
635 "static void\n"
636 "cleanup_handler(void *arg)\n"
637 "{\n"
638 " printf(\"Called clean-up handler\\[rs]n\");\n"
639 " cnt = 0;\n"
640 "}\n"
641 "\\&\n"
642 "static void *\n"
643 "thread_start(void *arg)\n"
644 "{\n"
645 " time_t curr;\n"
646 "\\&\n"
647 " printf(\"New thread started\\[rs]n\");\n"
648 "\\&\n"
649 " pthread_cleanup_push(cleanup_handler, NULL);\n"
650 "\\&\n"
651 " curr = time(NULL);\n"
652 "\\&\n"
653 " while (!done) {\n"
654 " pthread_testcancel(); /* A cancelation point */\n"
655 " if (curr E<lt> time(NULL)) {\n"
656 " curr = time(NULL);\n"
657 " printf(\"cnt = %d\\[rs]n\", cnt); /* A cancelation point */\n"
658 " cnt++;\n"
659 " }\n"
660 " }\n"
661 "\\&\n"
662 " pthread_cleanup_pop(cleanup_pop_arg);\n"
663 " return NULL;\n"
664 "}\n"
665 "\\&\n"
666 "int\n"
667 "main(int argc, char *argv[])\n"
668 "{\n"
669 " pthread_t thr;\n"
670 " int s;\n"
671 " void *res;\n"
672 "\\&\n"
673 " s = pthread_create(&thr, NULL, thread_start, NULL);\n"
674 " if (s != 0)\n"
675 " errc(EXIT_FAILURE, s, \"pthread_create\");\n"
676 "\\&\n"
677 " sleep(2); /* Allow new thread to run a while */\n"
678 "\\&\n"
679 " if (argc E<gt> 1) {\n"
680 " if (argc E<gt> 2)\n"
681 " cleanup_pop_arg = atoi(argv[2]);\n"
682 " done = 1;\n"
683 "\\&\n"
684 " } else {\n"
685 " printf(\"Canceling thread\\[rs]n\");\n"
686 " s = pthread_cancel(thr);\n"
687 " if (s != 0)\n"
688 " errc(EXIT_FAILURE, s, \"pthread_cancel\");\n"
689 " }\n"
690 "\\&\n"
691 " s = pthread_join(thr, &res);\n"
692 " if (s != 0)\n"
693 " errc(EXIT_FAILURE, s, \"pthread_join\");\n"
694 "\\&\n"
695 " if (res == PTHREAD_CANCELED)\n"
696 " printf(\"Thread was canceled; cnt = %d\\[rs]n\", cnt);\n"
697 " else\n"
698 " printf(\"Thread terminated normally; cnt = %d\\[rs]n\", cnt);\n"
699 " exit(EXIT_SUCCESS);\n"
700 "}\n"
701
702 #. SRC END
703 #. type: SH
704 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
705 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
706 #, no-wrap
707 msgid "SEE ALSO"
708 msgstr "انظر أيضًا"
709
710 #. type: Plain text
711 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
712 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
713 msgid ""
714 "B<pthread_cancel>(3), B<pthread_cleanup_push_defer_np>(3), "
715 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
716 msgstr ""
717 "B<pthread_cancel>(3)، B<pthread_cleanup_push_defer_np>(3)، "
718 "B<pthread_setcancelstate>(3)، B<pthread_testcancel>(3)، B<pthreads>(7)"
719
720 #. type: TH
721 #: debian-trixie
722 #, no-wrap
723 msgid "2024-06-15"
724 msgstr "15 يونيو 2024"
725
726 #. type: TH
727 #: debian-trixie
728 #, no-wrap
729 msgid "Linux man-pages 6.9.1"
730 msgstr "صفحات دليل لينكس 6.9.1"
731
732 #. type: Plain text
733 #: debian-trixie
734 msgid "POSIX threads library (I<libpthread>, I<-lpthread>)"
735 msgstr "مكتبة مسالك POSIX (I<libpthread>، I<-lpthread>)"
736
737 #. type: Plain text
738 #: debian-trixie
739 #, no-wrap
740 msgid ""
741 "B<void pthread_cleanup_push(void (*>I<routine>B<)(void *), void *>I<arg>B<);>\n"
742 "B<void pthread_cleanup_pop(int >I<execute>B<);>\n"
743 msgstr ""
744 "B<void pthread_cleanup_push(void (*>I<routine>B<)(void *), void *>I<arg>B<);>\n"
745 "B<void pthread_cleanup_pop(int >I<execute>B<);>\n"
746
747 #. type: Plain text
748 #: debian-trixie fedora-44 fedora-rawhide
749 #, no-wrap
750 msgid ""
751 "$ B<./a.out>\n"
752 "New thread started\n"
753 "cnt = 0\n"
754 "cnt = 1\n"
755 "Canceling thread\n"
756 "Called clean-up handler\n"
757 "Thread was canceled; cnt = 0\n"
758 msgstr ""
759 "$ B<./a.out>\n"
760 "New thread started\n"
761 "cnt = 0\n"
762 "cnt = 1\n"
763 "Canceling thread\n"
764 "Called clean-up handler\n"
765 "Thread was canceled; cnt = 0\n"
766
767 #. type: Plain text
768 #: debian-trixie fedora-44 fedora-rawhide
769 #, no-wrap
770 msgid ""
771 "$ B<./a.out x>\n"
772 "New thread started\n"
773 "cnt = 0\n"
774 "cnt = 1\n"
775 "Thread terminated normally; cnt = 2\n"
776 msgstr ""
777 "$ B<./a.out x>\n"
778 "New thread started\n"
779 "cnt = 0\n"
780 "cnt = 1\n"
781 "Thread terminated normally; cnt = 2\n"
782
783 #. type: Plain text
784 #: debian-trixie fedora-44 fedora-rawhide
785 #, no-wrap
786 msgid ""
787 "$ B<./a.out x 1>\n"
788 "New thread started\n"
789 "cnt = 0\n"
790 "cnt = 1\n"
791 "Called clean-up handler\n"
792 "Thread terminated normally; cnt = 0\n"
793 msgstr ""
794 "$ B<./a.out x 1>\n"
795 "New thread started\n"
796 "cnt = 0\n"
797 "cnt = 1\n"
798 "Called clean-up handler\n"
799 "Thread terminated normally; cnt = 0\n"
800
801 #. type: Plain text
802 #: debian-trixie fedora-44 fedora-rawhide
803 #, no-wrap
804 msgid ""
805 "#include E<lt>errno.hE<gt>\n"
806 "#include E<lt>pthread.hE<gt>\n"
807 "#include E<lt>stdio.hE<gt>\n"
808 "#include E<lt>stdlib.hE<gt>\n"
809 "#include E<lt>sys/types.hE<gt>\n"
810 "#include E<lt>unistd.hE<gt>\n"
811 "\\&\n"
812 "#define handle_error_en(en, msg) \\[rs]\n"
813 " do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n"
814 "\\&\n"
815 "static int done = 0;\n"
816 "static int cleanup_pop_arg = 0;\n"
817 "static int cnt = 0;\n"
818 "\\&\n"
819 "static void\n"
820 "cleanup_handler(void *arg)\n"
821 "{\n"
822 " printf(\"Called clean-up handler\\[rs]n\");\n"
823 " cnt = 0;\n"
824 "}\n"
825 "\\&\n"
826 "static void *\n"
827 "thread_start(void *arg)\n"
828 "{\n"
829 " time_t curr;\n"
830 "\\&\n"
831 " printf(\"New thread started\\[rs]n\");\n"
832 "\\&\n"
833 " pthread_cleanup_push(cleanup_handler, NULL);\n"
834 "\\&\n"
835 " curr = time(NULL);\n"
836 "\\&\n"
837 " while (!done) {\n"
838 " pthread_testcancel(); /* A cancelation point */\n"
839 " if (curr E<lt> time(NULL)) {\n"
840 " curr = time(NULL);\n"
841 " printf(\"cnt = %d\\[rs]n\", cnt); /* A cancelation point */\n"
842 " cnt++;\n"
843 " }\n"
844 " }\n"
845 "\\&\n"
846 " pthread_cleanup_pop(cleanup_pop_arg);\n"
847 " return NULL;\n"
848 "}\n"
849 "\\&\n"
850 "int\n"
851 "main(int argc, char *argv[])\n"
852 "{\n"
853 " pthread_t thr;\n"
854 " int s;\n"
855 " void *res;\n"
856 "\\&\n"
857 " s = pthread_create(&thr, NULL, thread_start, NULL);\n"
858 " if (s != 0)\n"
859 " handle_error_en(s, \"pthread_create\");\n"
860 "\\&\n"
861 " sleep(2); /* Allow new thread to run a while */\n"
862 "\\&\n"
863 " if (argc E<gt> 1) {\n"
864 " if (argc E<gt> 2)\n"
865 " cleanup_pop_arg = atoi(argv[2]);\n"
866 " done = 1;\n"
867 "\\&\n"
868 " } else {\n"
869 " printf(\"Canceling thread\\[rs]n\");\n"
870 " s = pthread_cancel(thr);\n"
871 " if (s != 0)\n"
872 " handle_error_en(s, \"pthread_cancel\");\n"
873 " }\n"
874 "\\&\n"
875 " s = pthread_join(thr, &res);\n"
876 " if (s != 0)\n"
877 " handle_error_en(s, \"pthread_join\");\n"
878 "\\&\n"
879 " if (res == PTHREAD_CANCELED)\n"
880 " printf(\"Thread was canceled; cnt = %d\\[rs]n\", cnt);\n"
881 " else\n"
882 " printf(\"Thread terminated normally; cnt = %d\\[rs]n\", cnt);\n"
883 " exit(EXIT_SUCCESS);\n"
884 "}\n"
885 msgstr ""
886 "#include E<lt>errno.hE<gt>\n"
887 "#include E<lt>pthread.hE<gt>\n"
888 "#include E<lt>stdio.hE<gt>\n"
889 "#include E<lt>stdlib.hE<gt>\n"
890 "#include E<lt>sys/types.hE<gt>\n"
891 "#include E<lt>unistd.hE<gt>\n"
892 "\\&\n"
893 "#define handle_error_en(en, msg) \\[rs]\n"
894 " do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n"
895 "\\&\n"
896 "static int done = 0;\n"
897 "static int cleanup_pop_arg = 0;\n"
898 "static int cnt = 0;\n"
899 "\\&\n"
900 "static void\n"
901 "cleanup_handler(void *arg)\n"
902 "{\n"
903 " printf(\"Called clean-up handler\\[rs]n\");\n"
904 " cnt = 0;\n"
905 "}\n"
906 "\\&\n"
907 "static void *\n"
908 "thread_start(void *arg)\n"
909 "{\n"
910 " time_t curr;\n"
911 "\\&\n"
912 " printf(\"New thread started\\[rs]n\");\n"
913 "\\&\n"
914 " pthread_cleanup_push(cleanup_handler, NULL);\n"
915 "\\&\n"
916 " curr = time(NULL);\n"
917 "\\&\n"
918 " while (!done) {\n"
919 " pthread_testcancel(); /* A cancelation point */\n"
920 " if (curr E<lt> time(NULL)) {\n"
921 " curr = time(NULL);\n"
922 " printf(\"cnt = %d\\[rs]n\", cnt); /* A cancelation point */\n"
923 " cnt++;\n"
924 " }\n"
925 " }\n"
926 "\\&\n"
927 " pthread_cleanup_pop(cleanup_pop_arg);\n"
928 " return NULL;\n"
929 "}\n"
930 "\\&\n"
931 "int\n"
932 "main(int argc, char *argv[])\n"
933 "{\n"
934 " pthread_t thr;\n"
935 " int s;\n"
936 " void *res;\n"
937 "\\&\n"
938 " s = pthread_create(&thr, NULL, thread_start, NULL);\n"
939 " if (s != 0)\n"
940 " handle_error_en(s, \"pthread_create\");\n"
941 "\\&\n"
942 " sleep(2); /* Allow new thread to run a while */\n"
943 "\\&\n"
944 " if (argc E<gt> 1) {\n"
945 " if (argc E<gt> 2)\n"
946 " cleanup_pop_arg = atoi(argv[2]);\n"
947 " done = 1;\n"
948 "\\&\n"
949 " } else {\n"
950 " printf(\"Canceling thread\\[rs]n\");\n"
951 " s = pthread_cancel(thr);\n"
952 " if (s != 0)\n"
953 " handle_error_en(s, \"pthread_cancel\");\n"
954 " }\n"
955 "\\&\n"
956 " s = pthread_join(thr, &res);\n"
957 " if (s != 0)\n"
958 " handle_error_en(s, \"pthread_join\");\n"
959 "\\&\n"
960 " if (res == PTHREAD_CANCELED)\n"
961 " printf(\"Thread was canceled; cnt = %d\\[rs]n\", cnt);\n"
962 " else\n"
963 " printf(\"Thread terminated normally; cnt = %d\\[rs]n\", cnt);\n"
964 " exit(EXIT_SUCCESS);\n"
965 "}\n"
966
967 #. type: TH
968 #: fedora-44 fedora-rawhide
969 #, no-wrap
970 msgid "2024-12-13"
971 msgstr "13 ديسمبر 2024"
972
973 #. type: TH
974 #: fedora-44 fedora-rawhide
975 #, no-wrap
976 msgid "Linux man-pages 6.13"
977 msgstr "صفحات دليل لينكس 6.13"
978
979 #. type: TH
980 #: mageia-cauldron
981 #, no-wrap
982 msgid "Linux man-pages 6.17"
983 msgstr "صفحات دليل لينكس 6.17"
984
985 #. type: TH
986 #: opensuse-leap-16-1 opensuse-tumbleweed
987 #, no-wrap
988 msgid "Linux man-pages (unreleased)"
989 msgstr "صفحات دليل لينكس (لم تصدر بعد)"