Debian Codegraph @

po/ru/man3/pthread_mutexattr_setrobust.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 " display_pthread_attr(&attr);\n"
32 msgid "pthread_mutexattr_setrobust"
33 msgstr " display_pthread_attr(&attr);\n"
34
35 #. type: TH
36 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
37 #: opensuse-tumbleweed
38 #, no-wrap
39 msgid "2026-02-08"
40 msgstr "8 февраля 2026 г."
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 msgid ""
60 "pthread_mutexattr_getrobust, pthread_mutexattr_setrobust - get and set the "
61 "robustness attribute of a mutex attributes object"
62 msgstr ""
63 "pthread_mutexattr_getrobust, pthread_mutexattr_setrobust - возвращает и "
64 "изменяет атрибут устойчивости в объекте мьютексных атрибутов"
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 "LIBRARY"
71 msgstr "БИБЛИОТЕКА"
72
73 #. type: Plain text
74 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
75 #: opensuse-leap-16-1 opensuse-tumbleweed
76 msgid "POSIX threads library (I<libpthread>,\\ I<-lpthread>)"
77 msgstr "Библиотека потоков POSIX (I<libpthread>,\\ I<-lpthread>)"
78
79 #. type: SH
80 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
81 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
82 #, no-wrap
83 msgid "SYNOPSIS"
84 msgstr "СИНТАКСИС"
85
86 #. type: Plain text
87 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
88 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
89 #, no-wrap
90 msgid "B<#include E<lt>pthread.hE<gt>>\n"
91 msgstr "B<#include E<lt>pthread.hE<gt>>\n"
92
93 #. type: Plain text
94 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
95 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
96 #, fuzzy, no-wrap
97 #| msgid ""
98 #| "B<int pthread_mutexattr_getrobust(const pthread_mutexattr_t *>I<attr>B<,>\n"
99 #| "B< int *>I<robustness>B<);>\n"
100 #| "B<int pthread_mutexattr_setrobust(const pthread_mutexattr_t *>I<attr>B<,>\n"
101 #| "B< int >I<robustness>B<);>\n"
102 msgid ""
103 "B<int pthread_mutexattr_getrobust(const pthread_mutexattr_t *>I<attr>B<,>\n"
104 "B< int *>I<robustness>B<);>\n"
105 "B<int pthread_mutexattr_setrobust(pthread_mutexattr_t *>I<attr>B<,>\n"
106 "B< int >I<robustness>B<);>\n"
107 msgstr ""
108 "B<int pthread_mutexattr_getrobust(const pthread_mutexattr_t *>I<attr>B<,>\n"
109 "B< int *>I<robustness>B<);>\n"
110 "B<int pthread_mutexattr_setrobust(const pthread_mutexattr_t *>I<attr>B<,>\n"
111 "B< int >I<robustness>B<);>\n"
112
113 #. type: Plain text
114 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
115 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
116 msgid ""
117 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
118 msgstr ""
119 "Требования макроса тестирования свойств для glibc (см. "
120 "B<feature_test_macros>(7)):"
121
122 #. type: Plain text
123 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
124 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
125 msgid "B<pthread_mutexattr_getrobust>(), B<pthread_mutexattr_setrobust>():"
126 msgstr "B<pthread_mutexattr_getrobust>(), B<pthread_mutexattr_setrobust>():"
127
128 #. FIXME .
129 #. But see https://sourceware.org/bugzilla/show_bug.cgi?id=22125
130 #. type: Plain text
131 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
132 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
133 #, no-wrap
134 msgid " _POSIX_C_SOURCE E<gt>= 200809L\n"
135 msgstr " _POSIX_C_SOURCE E<gt>= 200809L\n"
136
137 #. type: SH
138 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
139 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
140 #, no-wrap
141 msgid "DESCRIPTION"
142 msgstr "ОПИСАНИЕ"
143
144 #. type: Plain text
145 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
146 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
147 msgid ""
148 "The B<pthread_mutexattr_getrobust>() function places the value of the "
149 "robustness attribute of the mutex attributes object referred to by I<attr> "
150 "in I<*robustness>. The B<pthread_mutexattr_setrobust>() function sets the "
151 "value of the robustness attribute of the mutex attributes object referred to "
152 "by I<attr> to the value specified in I<*robustness>."
153 msgstr ""
154 "Функция B<pthread_mutexattr_getrobust>() помещает значение атрибута "
155 "устойчивости (robustness) из объекта мьютексных атрибутов, на который "
156 "указывает I<attr>, в I<*robustness>. Функция "
157 "B<pthread_mutexattr_setrobust>() изменяет значение атрибута устойчивости в "
158 "объекте мьютексных атрибутов, на который указывает I<attr>, на значение, "
159 "заданное в I<*robustness>."
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 "The robustness attribute specifies the behavior of the mutex when the owning "
166 "thread dies without unlocking the mutex. The following values are valid for "
167 "I<robustness>:"
168 msgstr ""
169 "Атрибут устойчивости определяет поведение мьютекса после того как владеющая "
170 "нить завершает работу, но не разблокировала мьютекс. Для I<robustness> "
171 "возможны следующие значения:"
172
173 #. type: TP
174 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
175 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
176 #, no-wrap
177 msgid "B<PTHREAD_MUTEX_STALLED>"
178 msgstr "B<PTHREAD_MUTEX_STALLED>"
179
180 #. type: Plain text
181 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
182 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
183 msgid ""
184 "This is the default value for a mutex attributes object. If a mutex is "
185 "initialized with the B<PTHREAD_MUTEX_STALLED> attribute and its owner dies "
186 "without unlocking it, the mutex remains locked afterwards and any future "
187 "attempts to call B<pthread_mutex_lock>(3) on the mutex will block "
188 "indefinitely."
189 msgstr ""
190 "Значение по умолчанию для объекта мьютексных атрибутов. Если мьютекс "
191 "инициализирован с атрибутом B<PTHREAD_MUTEX_STALLED> и его владелец "
192 "завершает работу без его разблокировки, то после этого мьютекс остаётся "
193 "заблокированным и все последующие попытки вызова B<pthread_mutex_lock>(3) "
194 "для этого мьютекса будут заблокированы навсегда."
195
196 #. type: TP
197 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
198 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
199 #, no-wrap
200 msgid "B<PTHREAD_MUTEX_ROBUST>"
201 msgstr "B<PTHREAD_MUTEX_ROBUST>"
202
203 #. type: Plain text
204 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
205 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
206 msgid ""
207 "If a mutex is initialized with the B<PTHREAD_MUTEX_ROBUST> attribute and its "
208 "owner dies without unlocking it, any future attempts to call "
209 "B<pthread_mutex_lock>(3) on this mutex will succeed and return "
210 "B<EOWNERDEAD> to indicate that the original owner no longer exists and the "
211 "mutex is in an inconsistent state. Usually after B<EOWNERDEAD> is returned, "
212 "the next owner should call B<pthread_mutex_consistent>(3) on the acquired "
213 "mutex to make it consistent again before using it any further."
214 msgstr ""
215 "Если мьютекса инициализирован с атрибутом B<PTHREAD_MUTEX_ROBUST> и и его "
216 "владелец завершает работу без его разблокировки,то все последующие попытки "
217 "вызова B<pthread_mutex_lock>(3) для этого мьютекса будут успешно выполнены "
218 "возвращается B<EOWNERDEAD>, чтобы показать, что первоначальный владелец не "
219 "существует и мьютекс находится в неопределенном состоянии. Обычно, после "
220 "возврата B<EOWNERDEAD> перед началом использования следующий владелец должен "
221 "вызвать B<pthread_mutex_consistent>(3) над полученным мьютексом, чтобы снова "
222 "сделать его согласованным."
223
224 #. type: Plain text
225 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
226 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
227 msgid ""
228 "If the next owner unlocks the mutex using B<pthread_mutex_unlock>(3) before "
229 "making it consistent, the mutex will be permanently unusable and any "
230 "subsequent attempts to lock it using B<pthread_mutex_lock>(3) will fail "
231 "with the error B<ENOTRECOVERABLE>. The only permitted operation on such a "
232 "mutex is B<pthread_mutex_destroy>(3)."
233 msgstr ""
234 "Если следующий владелец разблокирует мьютекс с помощью "
235 "B<pthread_mutex_unlock>(3) до того, как сделать его согласованным, мьютекс "
236 "станет необратимо неработоспособен и последующие попытки заблокировать его с "
237 "помощью B<pthread_mutex_lock>(3) будут завершаться ошибкой "
238 "B<ENOTRECOVERABLE>. Для такого мьютекса доступна только одна операция — "
239 "B<pthread_mutex_destroy>(3)."
240
241 #. type: Plain text
242 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
243 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
244 msgid ""
245 "If the next owner terminates before calling B<pthread_mutex_consistent>(3), "
246 "further B<pthread_mutex_lock>(3) operations on this mutex will still return "
247 "B<EOWNERDEAD>."
248 msgstr ""
249 "Если следующий владелец завершит работу до вызова "
250 "B<pthread_mutex_consistent>(3), то последующие операций "
251 "B<pthread_mutex_lock>(3) с этим мьютексом будут по прежнему возвращать "
252 "B<EOWNERDEAD>."
253
254 #. type: Plain text
255 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
256 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
257 msgid ""
258 "Note that the I<attr> argument of B<pthread_mutexattr_getrobust>() and "
259 "B<pthread_mutexattr_setrobust>() should refer to a mutex attributes object "
260 "that was initialized by B<pthread_mutexattr_init>(3), otherwise the behavior "
261 "is undefined."
262 msgstr ""
263 "Заметим, что аргумент I<attr> у B<pthread_mutexattr_getrobust>() и "
264 "B<pthread_mutexattr_setrobust>() должен указывать на объект мьютексных "
265 "атрибутов, который был инициализирован B<pthread_mutexattr_init>(3), в "
266 "противном случае поведение не определено."
267
268 #. type: SH
269 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
270 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
271 #, no-wrap
272 msgid "RETURN VALUE"
273 msgstr "ВОЗВРАЩАЕМОЕ ЗНАЧЕНИЕ"
274
275 #. type: Plain text
276 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
277 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
278 msgid ""
279 "On success, these functions return 0. On error, they return a positive "
280 "error number."
281 msgstr ""
282 "При успешном выполнении эти функции возвращают 0. При ошибке возвращается "
283 "положительный номер ошибки."
284
285 #. type: Plain text
286 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
287 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
288 msgid ""
289 "In the glibc implementation, B<pthread_mutexattr_getrobust>() always return "
290 "zero."
291 msgstr ""
292 "В реализации glibc функция B<pthread_mutexattr_getrobust>() всегда "
293 "возвращает ноль."
294
295 #. type: SH
296 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
297 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
298 #, no-wrap
299 msgid "ERRORS"
300 msgstr "ОШИБКИ"
301
302 #. type: TP
303 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
304 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
305 #, no-wrap
306 msgid "B<EINVAL>"
307 msgstr "B<EINVAL>"
308
309 #. type: Plain text
310 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
311 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
312 msgid ""
313 "A value other than B<PTHREAD_MUTEX_STALLED> or B<PTHREAD_MUTEX_ROBUST> was "
314 "passed to B<pthread_mutexattr_setrobust>()."
315 msgstr ""
316 "Помимо B<PTHREAD_MUTEX_STALLED> или B<PTHREAD_MUTEX_ROBUST> в "
317 "B<pthread_mutexattr_setrobust>() передано что-то ещё."
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 "VERSIONS"
324 msgstr "ВЕРСИИ"
325
326 #. E.g., Solaris, according to its manual page
327 #. type: Plain text
328 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
329 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
330 msgid ""
331 "In the Linux implementation, when using process-shared robust mutexes, a "
332 "waiting thread also receives the B<EOWNERDEAD> notification if the owner of "
333 "a robust mutex performs an B<execve>(2) without first unlocking the mutex. "
334 "POSIX.1 does not specify this detail, but the same behavior also occurs in "
335 "at least some other implementations."
336 msgstr ""
337 "В реализации Linux при использовании общих для процессов устойчивых "
338 "мьютексов ожидающая нить также получает уведомление B<EOWNERDEAD>, если "
339 "владелец устойчивого мьютекса выполняет B<execve>(2) без предварительной "
340 "разблокировки мьютекса. В POSIX.1 не указана данная подробность, но такое же "
341 "поведение также встречается и в нескольких других реализациях."
342
343 #. type: SH
344 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
345 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
346 #, no-wrap
347 msgid "STANDARDS"
348 msgstr "СТАНДАРТЫ"
349
350 #. type: Plain text
351 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
352 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
353 msgid "POSIX.1-2008."
354 msgstr "POSIX.1-2008."
355
356 #. type: SH
357 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
358 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
359 #, no-wrap
360 msgid "HISTORY"
361 msgstr "ИСТОРИЯ"
362
363 #. type: Plain text
364 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
365 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
366 msgid "glibc 2.12. POSIX.1-2008."
367 msgstr "glibc 2.12. POSIX.1-2008."
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 ""
373 "Before the addition of B<pthread_mutexattr_getrobust>() and "
374 "B<pthread_mutexattr_setrobust>() to POSIX, glibc defined the following "
375 "equivalent nonstandard functions if B<_GNU_SOURCE> was defined:"
376 msgstr ""
377 "До появления B<pthread_mutexattr_getrobust>() и "
378 "B<pthread_mutexattr_setrobust>() в POSIX, в glibc определись следующие "
379 "эквиваленты нестандартных функций, если определён B<_GNU_SOURCE>:"
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 #, fuzzy, no-wrap
385 #| msgid ""
386 #| "B<int pthread_mutexattr_getrobust_np(const pthread_mutexattr_t *>I<attr>B<,>\n"
387 #| "B< int *>I<robustness>B<);>\n"
388 #| "B<int pthread_mutexattr_setrobust_np(const pthread_mutexattr_t *>I<attr>B<,>\n"
389 #| "B< int >I<robustness>B<);>\n"
390 msgid ""
391 "B<[[deprecated]]>\n"
392 "B<int pthread_mutexattr_getrobust_np(const pthread_mutexattr_t *>I<attr>B<,>\n"
393 "B< int *>I<robustness>B<);>\n"
394 "B<[[deprecated]]>\n"
395 "B<int pthread_mutexattr_setrobust_np(const pthread_mutexattr_t *>I<attr>B<,>\n"
396 "B< int >I<robustness>B<);>\n"
397 msgstr ""
398 "B<int pthread_mutexattr_getrobust_np(const pthread_mutexattr_t *>I<attr>B<,>\n"
399 "B< int *>I<robustness>B<);>\n"
400 "B<int pthread_mutexattr_setrobust_np(const pthread_mutexattr_t *>I<attr>B<,>\n"
401 "B< int >I<robustness>B<);>\n"
402
403 #. type: Plain text
404 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
405 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
406 msgid ""
407 "Correspondingly, the constants B<PTHREAD_MUTEX_STALLED_NP> and "
408 "B<PTHREAD_MUTEX_ROBUST_NP> were also defined."
409 msgstr ""
410 "Соответственно, также определены константы B<PTHREAD_MUTEX_STALLED_NP> и "
411 "B<PTHREAD_MUTEX_ROBUST_NP>."
412
413 #. type: Plain text
414 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
415 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
416 #, fuzzy
417 #| msgid ""
418 #| "These GNU-specific APIs, which first appeared in glibc 2.4, are nowadays "
419 #| "obsolete and should not be used in new programs."
420 msgid ""
421 "These GNU-specific APIs, which first appeared in glibc 2.4, are nowadays "
422 "obsolete and should not be used in new programs; since glibc 2.34 these APIs "
423 "are marked as deprecated."
424 msgstr ""
425 "Данный имеющийся только в GNU программный интерфейс, впервые появившийся в "
426 "glibc 2.4, в настоящее время устарел и не должен использоваться в новых "
427 "программах."
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 "EXAMPLES"
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 ""
440 "The program below demonstrates the use of the robustness attribute of a "
441 "mutex attributes object. In this program, a thread holding the mutex dies "
442 "prematurely without unlocking the mutex. The main thread subsequently "
443 "acquires the mutex successfully and gets the error B<EOWNERDEAD>, after "
444 "which it makes the mutex consistent."
445 msgstr ""
446 "В программе, представленной далее, показывается использование атрибута "
447 "устойчивости в объекте мьютексных атрибутов. В этой программе нить, "
448 "удерживающая мьютекс, завершает работу без разблокировки мьютекса. После "
449 "этого главная нить захватывает мьютекс и получает ошибку B<EOWNERDEAD>, "
450 "после чего делает мьютекс согласованным."
451
452 #. type: Plain text
453 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
454 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
455 msgid ""
456 "The following shell session shows what we see when running this program:"
457 msgstr "Пример сеанса работы с программой:"
458
459 #. type: Plain text
460 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
461 #: opensuse-tumbleweed
462 #, fuzzy, no-wrap
463 #| msgid ""
464 #| "$ B<./a.out>\n"
465 #| "[original owner] Setting lock...\n"
466 #| "[original owner] Locked. Now exiting without unlocking.\n"
467 #| "[main thread] Attempting to lock the robust mutex.\n"
468 #| "[main thread] pthread_mutex_lock() returned EOWNERDEAD\n"
469 #| "[main thread] Now make the mutex consistent\n"
470 #| "[main thread] Mutex is now consistent; unlocking\n"
471 msgid ""
472 "$B< ./a.out>;\n"
473 "[original owner] Setting lock...\n"
474 "[original owner] Locked. Now exiting without unlocking.\n"
475 "[main] Attempting to lock the robust mutex.\n"
476 "[main] pthread_mutex_lock() returned EOWNERDEAD\n"
477 "[main] Now make the mutex consistent\n"
478 "[main] Mutex is now consistent; unlocking\n"
479 msgstr ""
480 "$ B<./a.out>\n"
481 "[первый владелец] Установка блокировки…\n"
482 "[первый владелец] Готово. Теперь выходим без разблокировки.\n"
483 "[главная нить] Пытаемся получить заблокировать устойчивый мьютекс.\n"
484 "[главная нить] pthread_mutex_lock() вернула EOWNERDEAD\n"
485 "[главная нить] Теперь делаем мьютекс согласованным\n"
486 "[главная нить] Мьютекс согласован; разблокируем\n"
487
488 #. type: SS
489 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
490 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
491 #, no-wrap
492 msgid "Program source"
493 msgstr "Исходный код программы"
494
495 #. type: Plain text
496 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
497 #: opensuse-tumbleweed
498 #, no-wrap
499 msgid ""
500 "#include E<lt>err.hE<gt>\n"
501 "#include E<lt>errno.hE<gt>\n"
502 "#include E<lt>pthread.hE<gt>\n"
503 "#include E<lt>stdio.hE<gt>\n"
504 "#include E<lt>stdlib.hE<gt>\n"
505 "#include E<lt>unistd.hE<gt>\n"
506 "\\&\n"
507 "static pthread_mutex_t mtx;\n"
508 "\\&\n"
509 "static void *\n"
510 "original_owner_thread(void *ptr)\n"
511 "{\n"
512 " printf(\"[original owner] Setting lock...\\[rs]n\");\n"
513 " pthread_mutex_lock(&mtx);\n"
514 " printf(\"[original owner] Locked. Now exiting without unlocking.\\[rs]n\");\n"
515 " pthread_exit(NULL);\n"
516 "}\n"
517 "\\&\n"
518 "int\n"
519 "main(void)\n"
520 "{\n"
521 " pthread_t thr;\n"
522 " pthread_mutexattr_t attr;\n"
523 " int s;\n"
524 "\\&\n"
525 " pthread_mutexattr_init(&attr);\n"
526 "\\&\n"
527 " pthread_mutexattr_setrobust(&attr, PTHREAD_MUTEX_ROBUST);\n"
528 "\\&\n"
529 " pthread_mutex_init(&mtx, &attr);\n"
530 "\\&\n"
531 " pthread_create(&thr, NULL, original_owner_thread, NULL);\n"
532 "\\&\n"
533 " sleep(2);\n"
534 "\\&\n"
535 " /* \"original_owner_thread\" should have exited by now. */\n"
536 "\\&\n"
537 " printf(\"[main] Attempting to lock the robust mutex.\\[rs]n\");\n"
538 " s = pthread_mutex_lock(&mtx);\n"
539 " if (s == EOWNERDEAD) {\n"
540 " printf(\"[main] pthread_mutex_lock() returned EOWNERDEAD\\[rs]n\");\n"
541 " printf(\"[main] Now make the mutex consistent\\[rs]n\");\n"
542 " s = pthread_mutex_consistent(&mtx);\n"
543 " if (s != 0)\n"
544 " errc(EXIT_FAILURE, s, \"pthread_mutex_consistent\");\n"
545 " printf(\"[main] Mutex is now consistent; unlocking\\[rs]n\");\n"
546 " s = pthread_mutex_unlock(&mtx);\n"
547 " if (s != 0)\n"
548 " errc(EXIT_FAILURE, s, \"pthread_mutex_unlock\");\n"
549 "\\&\n"
550 " exit(EXIT_SUCCESS);\n"
551 " } else if (s == 0) {\n"
552 " printf(\"[main] pthread_mutex_lock() unexpectedly succeeded\\[rs]n\");\n"
553 " exit(EXIT_FAILURE);\n"
554 " } else {\n"
555 " printf(\"[main] pthread_mutex_lock() unexpectedly failed\\[rs]n\");\n"
556 " errc(EXIT_FAILURE, s, \"pthread_mutex_lock\");\n"
557 " }\n"
558 "}\n"
559 msgstr ""
560
561 #. SRC END
562 #. type: SH
563 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
564 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
565 #, no-wrap
566 msgid "SEE ALSO"
567 msgstr "СМОТРИТЕ ТАКЖЕ"
568
569 #. type: Plain text
570 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
571 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
572 msgid ""
573 "B<get_robust_list>(2), B<set_robust_list>(2), "
574 "B<pthread_mutex_consistent>(3), B<pthread_mutex_init>(3), "
575 "B<pthread_mutex_lock>(3), B<pthreads>(7)"
576 msgstr ""
577 "B<get_robust_list>(2), B<set_robust_list>(2), "
578 "B<pthread_mutex_consistent>(3), B<pthread_mutex_init>(3), "
579 "B<pthread_mutex_lock>(3), B<pthreads>(7)"
580
581 #. type: TH
582 #: debian-trixie
583 #, no-wrap
584 msgid "2024-06-15"
585 msgstr "15 июня 2024 г."
586
587 #. type: TH
588 #: debian-trixie
589 #, no-wrap
590 msgid "Linux man-pages 6.9.1"
591 msgstr "Страницы руководства Linux 6.9.1"
592
593 #. type: Plain text
594 #: debian-trixie
595 msgid "POSIX threads library (I<libpthread>, I<-lpthread>)"
596 msgstr "Библиотека потоков POSIX (I<libpthread>, I<-lpthread>)"
597
598 #. type: Plain text
599 #: debian-trixie fedora-44 fedora-rawhide
600 #, fuzzy, no-wrap
601 #| msgid ""
602 #| "$ B<./a.out>\n"
603 #| "[original owner] Setting lock...\n"
604 #| "[original owner] Locked. Now exiting without unlocking.\n"
605 #| "[main thread] Attempting to lock the robust mutex.\n"
606 #| "[main thread] pthread_mutex_lock() returned EOWNERDEAD\n"
607 #| "[main thread] Now make the mutex consistent\n"
608 #| "[main thread] Mutex is now consistent; unlocking\n"
609 msgid ""
610 "$ B<./a.out>\n"
611 "[original owner] Setting lock...\n"
612 "[original owner] Locked. Now exiting without unlocking.\n"
613 "[main] Attempting to lock the robust mutex.\n"
614 "[main] pthread_mutex_lock() returned EOWNERDEAD\n"
615 "[main] Now make the mutex consistent\n"
616 "[main] Mutex is now consistent; unlocking\n"
617 msgstr ""
618 "$ B<./a.out>\n"
619 "[первый владелец] Установка блокировки…\n"
620 "[первый владелец] Готово. Теперь выходим без разблокировки.\n"
621 "[главная нить] Пытаемся получить заблокировать устойчивый мьютекс.\n"
622 "[главная нить] pthread_mutex_lock() вернула EOWNERDEAD\n"
623 "[главная нить] Теперь делаем мьютекс согласованным\n"
624 "[главная нить] Мьютекс согласован; разблокируем\n"
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 pthread_mutex_t mtx;\n"
640 "\\&\n"
641 "static void *\n"
642 "original_owner_thread(void *ptr)\n"
643 "{\n"
644 " printf(\"[original owner] Setting lock...\\[rs]n\");\n"
645 " pthread_mutex_lock(&mtx);\n"
646 " printf(\"[original owner] Locked. Now exiting without unlocking.\\[rs]n\");\n"
647 " pthread_exit(NULL);\n"
648 "}\n"
649 "\\&\n"
650 "int\n"
651 "main(void)\n"
652 "{\n"
653 " pthread_t thr;\n"
654 " pthread_mutexattr_t attr;\n"
655 " int s;\n"
656 "\\&\n"
657 " pthread_mutexattr_init(&attr);\n"
658 "\\&\n"
659 " pthread_mutexattr_setrobust(&attr, PTHREAD_MUTEX_ROBUST);\n"
660 "\\&\n"
661 " pthread_mutex_init(&mtx, &attr);\n"
662 "\\&\n"
663 " pthread_create(&thr, NULL, original_owner_thread, NULL);\n"
664 "\\&\n"
665 " sleep(2);\n"
666 "\\&\n"
667 " /* \"original_owner_thread\" should have exited by now. */\n"
668 "\\&\n"
669 " printf(\"[main] Attempting to lock the robust mutex.\\[rs]n\");\n"
670 " s = pthread_mutex_lock(&mtx);\n"
671 " if (s == EOWNERDEAD) {\n"
672 " printf(\"[main] pthread_mutex_lock() returned EOWNERDEAD\\[rs]n\");\n"
673 " printf(\"[main] Now make the mutex consistent\\[rs]n\");\n"
674 " s = pthread_mutex_consistent(&mtx);\n"
675 " if (s != 0)\n"
676 " handle_error_en(s, \"pthread_mutex_consistent\");\n"
677 " printf(\"[main] Mutex is now consistent; unlocking\\[rs]n\");\n"
678 " s = pthread_mutex_unlock(&mtx);\n"
679 " if (s != 0)\n"
680 " handle_error_en(s, \"pthread_mutex_unlock\");\n"
681 "\\&\n"
682 " exit(EXIT_SUCCESS);\n"
683 " } else if (s == 0) {\n"
684 " printf(\"[main] pthread_mutex_lock() unexpectedly succeeded\\[rs]n\");\n"
685 " exit(EXIT_FAILURE);\n"
686 " } else {\n"
687 " printf(\"[main] pthread_mutex_lock() unexpectedly failed\\[rs]n\");\n"
688 " handle_error_en(s, \"pthread_mutex_lock\");\n"
689 " }\n"
690 "}\n"
691 msgstr ""
692
693 #. type: TH
694 #: fedora-44 fedora-rawhide
695 #, no-wrap
696 msgid "2024-07-23"
697 msgstr "23 июля 2024 г."
698
699 #. type: TH
700 #: fedora-44 fedora-rawhide
701 #, no-wrap
702 msgid "Linux man-pages 6.13"
703 msgstr "Страницы руководства Linux 6.13"
704
705 #. type: TH
706 #: mageia-cauldron
707 #, no-wrap
708 msgid "Linux man-pages 6.17"
709 msgstr "Страницы руководства Linux 6.17"
710
711 #. type: TH
712 #: opensuse-leap-16-1 opensuse-tumbleweed
713 #, no-wrap
714 msgid "Linux man-pages (unreleased)"
715 msgstr "Страницы руководства Linux (не выпущены)"