GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — python-docs-ja/library/asyncio-sync.po at 3.13 · python/python-docs-ja

Expand file tree

/

asyncio-sync.po

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
804 lines (704 loc) · 29.9 KB
/

asyncio-sync.po

Copy path

File metadata and controls

804 lines (704 loc) · 29.9 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001 Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# Takeshi Nakazato, 2022
# tomo, 2022
# Arihiro TAKASE, 2023
# Takuya Futatsugi, 2024
# 石井明久, 2024
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.14\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-05-16 14:19+0000\n"
"PO-Revision-Date: 2021-06-28 00:55+0000\n"
"Last-Translator: 石井明久, 2024\n"
"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/"
"ja/)\n"
"Language: ja\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#: ../../library/asyncio-sync.rst:7
msgid "Synchronization Primitives"
msgstr "同期プリミティブ"
#: ../../library/asyncio-sync.rst:9
msgid "**Source code:** :source:`Lib/asyncio/locks.py`"
msgstr "**ソースコード:** :source:`Lib/asyncio/locks.py`"
#: ../../library/asyncio-sync.rst:13
msgid ""
"asyncio synchronization primitives are designed to be similar to those of "
"the :mod:`threading` module with two important caveats:"
msgstr ""
"asyncio の同期プリミティブは :mod:`threading` モジュールのそれと類似するよう"
"にデザインされていますが、2つの重要な注意事項があります:"
#: ../../library/asyncio-sync.rst:16
msgid ""
"asyncio primitives are not thread-safe, therefore they should not be used "
"for OS thread synchronization (use :mod:`threading` for that);"
msgstr ""
"asyncio の同期プリミティブはスレッドセーフではありません。従って OS スレッド"
"の同期に使うべきではありません (代わりに :mod:`threading` を使ってください);"
#: ../../library/asyncio-sync.rst:20
msgid ""
"methods of these synchronization primitives do not accept the *timeout* "
"argument; use the :func:`asyncio.wait_for` function to perform operations "
"with timeouts."
msgstr ""
"同期プリミティブのメソッドは *timeout* 引数を受け付けません; タイムアウトを伴"
"う操作を実行するには :func:`asyncio.wait_for` 関数を使ってください。"
#: ../../library/asyncio-sync.rst:24
msgid "asyncio has the following basic synchronization primitives:"
msgstr "asyncio モジュールは以下の基本的な同期プリミティブを持っています:"
#: ../../library/asyncio-sync.rst:26
msgid ":class:`Lock`"
msgstr ":class:`Lock`"
#: ../../library/asyncio-sync.rst:27
msgid ":class:`Event`"
msgstr ":class:`Event`"
#: ../../library/asyncio-sync.rst:28
msgid ":class:`Condition`"
msgstr ":class:`Condition`"
#: ../../library/asyncio-sync.rst:29
msgid ":class:`Semaphore`"
msgstr ":class:`Semaphore`"
#: ../../library/asyncio-sync.rst:30
msgid ":class:`BoundedSemaphore`"
msgstr ":class:`BoundedSemaphore`"
#: ../../library/asyncio-sync.rst:31
msgid ":class:`Barrier`"
msgstr ":class:`Barrier`"
#: ../../library/asyncio-sync.rst:38
msgid "Lock"
msgstr "Lock"
#: ../../library/asyncio-sync.rst:42
msgid "Implements a mutex lock for asyncio tasks. Not thread-safe."
msgstr ""
"asyncio タスクのためのミューテックスロックを実装しています。スレッドセーフで"
"はありません。"
#: ../../library/asyncio-sync.rst:44
msgid ""
"An asyncio lock can be used to guarantee exclusive access to a shared "
"resource."
msgstr ""
"asyncio ロックは、共有リソースに対する排他的なアクセスを保証するために使うこ"
"とができます。"
#: ../../library/asyncio-sync.rst:47
msgid "The preferred way to use a Lock is an :keyword:`async with` statement::"
msgstr ""
"Lock の望ましい使用方法は、 :keyword:`async with` 文と組み合わせて使うことで"
"す::"
msgid ""
"lock = asyncio.Lock()\n"
"\n"
"# ... later\n"
"async with lock:\n"
" # access shared state"
msgstr ""
"lock = asyncio.Lock()\n"
"\n"
"# ... 後で\n"
"async with lock:\n"
" # 共有状態にアクセスする"
#: ../../library/asyncio-sync.rst:56 ../../library/asyncio-sync.rst:201
#: ../../library/asyncio-sync.rst:309
msgid "which is equivalent to::"
msgstr "これは以下のコードと等価です::"
msgid ""
"lock = asyncio.Lock()\n"
"\n"
"# ... later\n"
"await lock.acquire()\n"
"try:\n"
" # access shared state\n"
"finally:\n"
" lock.release()"
msgstr ""
"lock = asyncio.Lock()\n"
"\n"
"# ... 後で\n"
"await lock.acquire()\n"
"try:\n"
" # 共有状態にアクセスする\n"
"finally:\n"
" lock.release()"
#: ../../library/asyncio-sync.rst:67 ../../library/asyncio-sync.rst:113
#: ../../library/asyncio-sync.rst:189 ../../library/asyncio-sync.rst:297
#: ../../library/asyncio-sync.rst:353
msgid "Removed the *loop* parameter."
msgstr "*loop* パラメータが削除されました。"
#: ../../library/asyncio-sync.rst:73
msgid "Acquire the lock."
msgstr "ロックを獲得します。"
#: ../../library/asyncio-sync.rst:75
msgid ""
"This method waits until the lock is *unlocked*, sets it to *locked* and "
"returns ``True``."
msgstr ""
"このメソッドはロックが *解除される* まで待機し、ロックを *ロック状態* に変更"
"して ``True`` を返します。"
#: ../../library/asyncio-sync.rst:78
msgid ""
"When more than one coroutine is blocked in :meth:`acquire` waiting for the "
"lock to be unlocked, only one coroutine eventually proceeds."
msgstr ""
"複数のコルーチンが :meth:`acquire` メソッドによりロックの解除を待ち受けている"
"場合、最終的にただひとつのコルーチンが実行されます。"
#: ../../library/asyncio-sync.rst:82
msgid ""
"Acquiring a lock is *fair*: the coroutine that proceeds will be the first "
"coroutine that started waiting on the lock."
msgstr ""
"ロックの獲得は *公平* です: すなわちロックを獲得して実行されるコルーチンは、"
"最初にロックの待ち受けを開始したコルーチンです。"
#: ../../library/asyncio-sync.rst:87
msgid "Release the lock."
msgstr "ロックを解放します。"
#: ../../library/asyncio-sync.rst:89
msgid "When the lock is *locked*, reset it to *unlocked* and return."
msgstr ""
"ロックが *ロック状態* の場合、 ロックを *解除状態* にしてリターンします。"
#: ../../library/asyncio-sync.rst:91
msgid "If the lock is *unlocked*, a :exc:`RuntimeError` is raised."
msgstr "ロックが *解除状態* の場合、 :exc:`RuntimeError` 例外が送出されます。"
#: ../../library/asyncio-sync.rst:95
msgid "Return ``True`` if the lock is *locked*."
msgstr "*ロック状態* の場合に ``True`` を返します。"
#: ../../library/asyncio-sync.rst:99
msgid "Event"
msgstr "Event"
#: ../../library/asyncio-sync.rst:103
msgid "An event object. Not thread-safe."
msgstr "イベントオブジェクトです。スレッドセーフではありません。"
#: ../../library/asyncio-sync.rst:105
msgid ""
"An asyncio event can be used to notify multiple asyncio tasks that some "
"event has happened."
msgstr ""
"asyncio イベントは、複数の asyncio タスクに対して何らかのイベントが発生したこ"
"とを通知するために使うことができます。"
#: ../../library/asyncio-sync.rst:108
msgid ""
"An Event object manages an internal flag that can be set to *true* with "
"the :meth:`~Event.set` method and reset to *false* with the :meth:`clear` "
"method. The :meth:`~Event.wait` method blocks until the flag is set to "
"*true*. The flag is set to *false* initially."
msgstr ""
"Event オブジェクトは内部フラグを管理します。フラグの値は :meth:`~Event.set` "
"メソッドにより *true* に、また :meth:`clear` メソッドにより *false* に設定す"
"ることができます。 :meth:`~Event.wait` メソッドはフラグが *true* になるまで処"
"理をブロックします。フラグの初期値は *false* です。"
#: ../../library/asyncio-sync.rst:118 ../../library/asyncio-sync.rst:377
msgid "Example::"
msgstr "以下はプログラム例です::"
msgid ""
"async def waiter(event):\n"
" print('waiting for it ...')\n"
" await event.wait()\n"
" print('... got it!')\n"
"\n"
"async def main():\n"
" # Create an Event object.\n"
" event = asyncio.Event()\n"
"\n"
" # Spawn a Task to wait until 'event' is set.\n"
" waiter_task = asyncio.create_task(waiter(event))\n"
"\n"
" # Sleep for 1 second and set the event.\n"
" await asyncio.sleep(1)\n"
" event.set()\n"
"\n"
" # Wait until the waiter task is finished.\n"
" await waiter_task\n"
"\n"
"asyncio.run(main())"
msgstr ""
"async def waiter(event):\n"
" print('waiting for it ...')\n"
" await event.wait()\n"
" print('... got it!')\n"
"\n"
"async def main():\n"
" # Event オブジェクトを作成する。\n"
" event = asyncio.Event()\n"
"\n"
" # 'event' がセットされるまで待機するタスクを起動する。\n"
" waiter_task = asyncio.create_task(waiter(event))\n"
"\n"
" # 1 秒待ってからイベントをセットする。\n"
" await asyncio.sleep(1)\n"
" event.set()\n"
"\n"
" # 待機中のタスクが終了するまで待つ。\n"
" await waiter_task\n"
"\n"
"asyncio.run(main())"
#: ../../library/asyncio-sync.rst:144
msgid "Wait until the event is set."
msgstr "イベントがセットされるまで待機します。"
#: ../../library/asyncio-sync.rst:146
msgid ""
"If the event is set, return ``True`` immediately. Otherwise block until "
"another task calls :meth:`~Event.set`."
msgstr ""
"イベントがセットされると、即座に ``True`` を返します。 そうでなければ、他のタ"
"スクが :meth:`~Event.set` メソッドを呼び出すまで処理をブロックします。"
#: ../../library/asyncio-sync.rst:151
msgid "Set the event."
msgstr "イベントをセットします。"
#: ../../library/asyncio-sync.rst:153
msgid "All tasks waiting for event to be set will be immediately awakened."
msgstr ""
"イベントがセットされるまで待機している全てのタスクは、即座に通知を受けて実行"
"を再開します。"
#: ../../library/asyncio-sync.rst:158
msgid "Clear (unset) the event."
msgstr "イベントをクリア (アンセット) します"
#: ../../library/asyncio-sync.rst:160
msgid ""
"Tasks awaiting on :meth:`~Event.wait` will now block until "
"the :meth:`~Event.set` method is called again."
msgstr ""
":meth:`~Event.wait` メソッドで待ち受けを行うタスクは :meth:`~Event.set` メ"
"ソッドが再度呼び出されるまで処理をブロックします。"
#: ../../library/asyncio-sync.rst:165
msgid "Return ``True`` if the event is set."
msgstr "イベントがセットされている場合 ``True`` を返します。"
#: ../../library/asyncio-sync.rst:169
msgid "Condition"
msgstr "Condition"
#: ../../library/asyncio-sync.rst:173
msgid "A Condition object. Not thread-safe."
msgstr "条件変数オブジェクトです。スレッドセーフではありません。"
#: ../../library/asyncio-sync.rst:175
msgid ""
"An asyncio condition primitive can be used by a task to wait for some event "
"to happen and then get exclusive access to a shared resource."
msgstr ""
"asyncio 条件プリミティブは何らかのイベントが発生するのを待ち受け、そのイベン"
"トを契機として共有リソースへの排他的なアクセスを得るために利用することができ"
"ます。"
#: ../../library/asyncio-sync.rst:179
msgid ""
"In essence, a Condition object combines the functionality of "
"an :class:`Event` and a :class:`Lock`. It is possible to have multiple "
"Condition objects share one Lock, which allows coordinating exclusive access "
"to a shared resource between different tasks interested in particular states "
"of that shared resource."
msgstr ""
"本質的に、 Condition オブジェクトは :class:`Event` と a :class:`Lock` の2つの"
"クラスの機能を組み合わせたものです。複数の Condition オブジェクトが単一の "
"Lock を共有することでができます。これにより、共有リソースのそれぞれの状態に関"
"連する異なるタスクの間で、そのリソースへの排他的アクセスを調整することが可能"
"になります。"
#: ../../library/asyncio-sync.rst:185
msgid ""
"The optional *lock* argument must be a :class:`Lock` object or ``None``. In "
"the latter case a new Lock object is created automatically."
msgstr ""
"オプション引数 *lock* は :class:`Lock` または ``None`` でなければなりません。"
"後者の場合自動的に新しい Lock オブジェクトが生成されます。"
#: ../../library/asyncio-sync.rst:192
msgid ""
"The preferred way to use a Condition is an :keyword:`async with` statement::"
msgstr ""
"Condition の望ましい使用方法は :keyword:`async with` 文と組み合わせて使うこと"
"です::"
msgid ""
"cond = asyncio.Condition()\n"
"\n"
"# ... later\n"
"async with cond:\n"
" await cond.wait()"
msgstr ""
"cond = asyncio.Condition()\n"
"\n"
"# ... 後で\n"
"async with cond:\n"
" await cond.wait()"
msgid ""
"cond = asyncio.Condition()\n"
"\n"
"# ... later\n"
"await cond.acquire()\n"
"try:\n"
" await cond.wait()\n"
"finally:\n"
" cond.release()"
msgstr ""
"cond = asyncio.Condition()\n"
"\n"
"# ... 後で\n"
"await cond.acquire()\n"
"try:\n"
" await cond.wait()\n"
"finally:\n"
" cond.release()"
#: ../../library/asyncio-sync.rst:215
msgid "Acquire the underlying lock."
msgstr "下層でのロックを獲得します。"
#: ../../library/asyncio-sync.rst:217
msgid ""
"This method waits until the underlying lock is *unlocked*, sets it to "
"*locked* and returns ``True``."
msgstr ""
"このメソッドは下層のロックが *解除される* まで待機し、ロックを *ロック状態* "
"に変更して ``True`` を返します。"
msgid ""
"Wake up *n* tasks (1 by default) waiting on this condition. If fewer than "
"*n* tasks are waiting they are all awakened."
msgstr ""
"この条件変数で待機しているタスクを *n* 個 (デフォルトは 1 個) 起こします。\n"
"待機しているタスクが *n* 個未満なら、すべて起こします。"
#: ../../library/asyncio-sync.rst:225 ../../library/asyncio-sync.rst:240
msgid ""
"The lock must be acquired before this method is called and released shortly "
"after. If called with an *unlocked* lock a :exc:`RuntimeError` error is "
"raised."
msgstr ""
"このメソッドが呼び出される前にロックを獲得しておかなければなりません。また、"
"メソッド呼び出し後速やかにロックを解除しなければなりません。 *解除された* "
"ロックとと共に呼び出された場合、 :exc:`RuntimeError` 例外が送出されます。"
#: ../../library/asyncio-sync.rst:231
msgid "Return ``True`` if the underlying lock is acquired."
msgstr "下層のロックを獲得していれば ``True`` を返します。"
#: ../../library/asyncio-sync.rst:235
msgid "Wake up all tasks waiting on this condition."
msgstr "この条件を待ち受けている全てのタスクを起動します。"
#: ../../library/asyncio-sync.rst:237
msgid "This method acts like :meth:`notify`, but wakes up all waiting tasks."
msgstr ""
"このメソッドは :meth:`notify` と同じように振る舞いますが、待ち受けている全て"
"のタスクを起動します。"
#: ../../library/asyncio-sync.rst:246
msgid "Release the underlying lock."
msgstr "下層のロックを解除します。"
#: ../../library/asyncio-sync.rst:248
msgid "When invoked on an unlocked lock, a :exc:`RuntimeError` is raised."
msgstr ""
"アンロック状態のロックに対して呼び出された場合、:exc:`RuntimeError` が送出さ"
"れます。"
#: ../../library/asyncio-sync.rst:254
msgid "Wait until notified."
msgstr "通知を受けるまで待機します。"
#: ../../library/asyncio-sync.rst:256
msgid ""
"If the calling task has not acquired the lock when this method is called, "
"a :exc:`RuntimeError` is raised."
msgstr ""
"このメソッドが呼び出された時点で呼び出し元のタスクがロックを獲得していない場"
"合、 :exc:`RuntimeError` 例外が送出されます。"
#: ../../library/asyncio-sync.rst:259
msgid ""
"This method releases the underlying lock, and then blocks until it is "
"awakened by a :meth:`notify` or :meth:`notify_all` call. Once awakened, the "
"Condition re-acquires its lock and this method returns ``True``."
msgstr ""
"このメソッドは下層のロックを解除し、その後 :meth:`notify` また"
"は :meth:`notify_all` の呼び出しによって起動されるまで処理をブロックします。"
"いったん起動されると、 Condition は再びロックを獲得し、メソッドは ``True`` "
"を返します。"
msgid ""
"Note that a task *may* return from this call spuriously, which is why the "
"caller should always re-check the state and be prepared "
"to :meth:`~Condition.wait` again. For this reason, you may prefer to "
"use :meth:`~Condition.wait_for` instead."
msgstr ""
"この呼び出しは、通知を受けていなくても返る *場合があります*。\n"
"そのため、呼び出し側では必ず状態を再確認し、必要なら再"
"び :meth:`~Condition.wait` できるようにしてください。\n"
"このため、代わりに :meth:`~Condition.wait_for` を使う方が適している場合もあり"
"ます。"
msgid "Wait until a predicate becomes *true*."
msgstr "``predicate`` の評価結果が *真* になるまで待機します。"
msgid ""
"The predicate must be a callable which result will be interpreted as a "
"boolean value. The method will repeatedly :meth:`~Condition.wait` until the "
"predicate evaluates to *true*. The final value is the return value."
msgstr ""
"``predicate`` は呼び出し可能オブジェクトでなければならず、その結果はブール値"
"として解釈されます。\n"
"このメソッドは ``predicate`` の評価結果が *真* になるま"
"で :meth:`~Condition.wait` を繰り返し、最後の評価結果を返します。"
#: ../../library/asyncio-sync.rst:281
msgid "Semaphore"
msgstr "Semaphore"
#: ../../library/asyncio-sync.rst:285
msgid "A Semaphore object. Not thread-safe."
msgstr "セマフォオブジェクトです。スレッドセーフではありません。"
#: ../../library/asyncio-sync.rst:287
msgid ""
"A semaphore manages an internal counter which is decremented by "
"each :meth:`acquire` call and incremented by each :meth:`release` call. The "
"counter can never go below zero; when :meth:`acquire` finds that it is zero, "
"it blocks, waiting until some task calls :meth:`release`."
msgstr ""
"セマフォは内部のカウンターを管理しています。カウンターは :meth:`acquire` メ"
"ソッドの呼び出しによって減算され、 :meth:`release` メソッドの呼び出しによって"
"加算されます。カウンターがゼロを下回ることはありません。 :meth:`acquire` メ"
"ソッドが呼び出された時にカウンターがゼロになっていると、セマフォは処理をブ"
"ロックし、他のタスクが :meth:`release` メソッドを呼び出すまで待機します。"
#: ../../library/asyncio-sync.rst:293
msgid ""
"The optional *value* argument gives the initial value for the internal "
"counter (``1`` by default). If the given value is less than ``0`` "
"a :exc:`ValueError` is raised."
msgstr ""
"オプション引数 *value* は内部カウンターの初期値を与えます (デフォルトは "
"``1`` です)。 指定された値が ``0`` より小さい場合、 :exc:`ValueError` 例外が"
"送出されます。"
#: ../../library/asyncio-sync.rst:300
msgid ""
"The preferred way to use a Semaphore is an :keyword:`async with` statement::"
msgstr ""
"セマフォの望ましい使用方法は、 :keyword:`async with` 文と組み合わせて使うこと"
"です::"
msgid ""
"sem = asyncio.Semaphore(10)\n"
"\n"
"# ... later\n"
"async with sem:\n"
" # work with shared resource"
msgstr ""
"sem = asyncio.Semaphore(10)\n"
"\n"
"# ... 後で\n"
"async with sem:\n"
" # 共有リソースを操作する"
msgid ""
"sem = asyncio.Semaphore(10)\n"
"\n"
"# ... later\n"
"await sem.acquire()\n"
"try:\n"
" # work with shared resource\n"
"finally:\n"
" sem.release()"
msgstr ""
"sem = asyncio.Semaphore(10)\n"
"\n"
"# ... 後で\n"
"await sem.acquire()\n"
"try:\n"
" # 共有リソースを操作する\n"
"finally:\n"
" sem.release()"
#: ../../library/asyncio-sync.rst:323
msgid "Acquire a semaphore."
msgstr "セマフォを獲得します。"
#: ../../library/asyncio-sync.rst:325
msgid ""
"If the internal counter is greater than zero, decrement it by one and return "
"``True`` immediately. If it is zero, wait until a :meth:`release` is called "
"and return ``True``."
msgstr ""
"内部カウンターがゼロより大きい場合、カウンターを1つ減算して即座に ``True`` を"
"返します。内部カウンターがゼロの場合、 :meth:`release` が呼び出されるまで待機"
"してから ``True`` を返します。"
#: ../../library/asyncio-sync.rst:331
msgid "Returns ``True`` if semaphore can not be acquired immediately."
msgstr "セマフォを直ちに獲得できない場合 ``True`` を返します。"
#: ../../library/asyncio-sync.rst:335
msgid ""
"Release a semaphore, incrementing the internal counter by one. Can wake up a "
"task waiting to acquire the semaphore."
msgstr ""
"セマフォを解放し、内部カウンターを1つ加算します。セマフォ待ちをしているタスク"
"を起動する可能性があります。"
#: ../../library/asyncio-sync.rst:338
msgid ""
"Unlike :class:`BoundedSemaphore`, :class:`Semaphore` allows making more "
"``release()`` calls than ``acquire()`` calls."
msgstr ""
":class:`BoundedSemaphore` と異なり、 :class:`Semaphore` は ``release()`` を "
"``acquire()`` よりも多く呼び出すことを許容します。"
#: ../../library/asyncio-sync.rst:343
msgid "BoundedSemaphore"
msgstr "BoundedSemaphore"
#: ../../library/asyncio-sync.rst:347
msgid "A bounded semaphore object. Not thread-safe."
msgstr "有限セマフォオブジェクトです。スレッドセーフではありません。"
msgid ""
"Bounded Semaphore is a version of :class:`Semaphore` that raises "
"a :exc:`ValueError` in :meth:`~Semaphore.release` if it increases the "
"internal counter above the initial *value*."
msgstr ""
"有限セマフォは :class:`Semaphore` の一種です。\n"
":meth:`~Semaphore.release` によって内部カウンターが初期値 *value* を超える場"
"合、:exc:`ValueError` を送出します。"
msgid "Barrier"
msgstr "Barrier"
msgid "A barrier object. Not thread-safe."
msgstr ""
"バリアオブジェクトです。\n"
"スレッドセーフではありません。"
msgid ""
"A barrier is a simple synchronization primitive that allows to block until "
"*parties* number of tasks are waiting on it. Tasks can wait on "
"the :meth:`~Barrier.wait` method and would be blocked until the specified "
"number of tasks end up waiting on :meth:`~Barrier.wait`. At that point all "
"of the waiting tasks would unblock simultaneously."
msgstr ""
"バリアは、*parties* 個のタスクが待機するまでブロックできる単純な同期プリミ"
"ティブです。\n"
"タスクは :meth:`~Barrier.wait` メソッドで待機でき、指定した数のタスク"
"が :meth:`~Barrier.wait` で待機するまでブロックされます。\n"
"その時点で、待機しているすべてのタスクのブロックが同時に解除されます。"
msgid ""
":keyword:`async with` can be used as an alternative to awaiting "
"on :meth:`~Barrier.wait`."
msgstr ""
":meth:`~Barrier.wait` を await する代わりに :keyword:`async with` を使えま"
"す。"
msgid "The barrier can be reused any number of times."
msgstr "バリアは何度でも再利用できます。"
msgid ""
"async def example_barrier():\n"
" # barrier with 3 parties\n"
" b = asyncio.Barrier(3)\n"
"\n"
" # create 2 new waiting tasks\n"
" asyncio.create_task(b.wait())\n"
" asyncio.create_task(b.wait())\n"
"\n"
" await asyncio.sleep(0)\n"
" print(b)\n"
"\n"
" # The third .wait() call passes the barrier\n"
" await b.wait()\n"
" print(b)\n"
" print(\"barrier passed\")\n"
"\n"
" await asyncio.sleep(0)\n"
" print(b)\n"
"\n"
"asyncio.run(example_barrier())"
msgstr ""
"async def example_barrier():\n"
" # 3 タスクが参加するバリア\n"
" b = asyncio.Barrier(3)\n"
"\n"
" # 待機するタスクを 2 つ作成する\n"
" asyncio.create_task(b.wait())\n"
" asyncio.create_task(b.wait())\n"
"\n"
" await asyncio.sleep(0)\n"
" print(b)\n"
"\n"
" # 3 回目の .wait() の呼び出しでバリアを通過する\n"
" await b.wait()\n"
" print(b)\n"
" print(\"barrier passed\")\n"
"\n"
" await asyncio.sleep(0)\n"
" print(b)\n"
"\n"
"asyncio.run(example_barrier())"
msgid "Result of this example is::"
msgstr "この例の実行結果は次のとおりです。 ::"
msgid ""
"<asyncio.locks.Barrier object at 0x... [filling, waiters:2/3]>\n"
"<asyncio.locks.Barrier object at 0x... [draining, waiters:0/3]>\n"
"barrier passed\n"
"<asyncio.locks.Barrier object at 0x... [filling, waiters:0/3]>"
msgstr ""
"<asyncio.locks.Barrier object at 0x... [filling, waiters:2/3]>\n"
"<asyncio.locks.Barrier object at 0x... [draining, waiters:0/3]>\n"
"barrier passed\n"
"<asyncio.locks.Barrier object at 0x... [filling, waiters:0/3]>"
msgid ""
"Pass the barrier. When all the tasks party to the barrier have called this "
"function, they are all unblocked simultaneously."
msgstr ""
"バリアを通過します。\n"
"バリアに参加するすべてのタスクがこの関数を呼び出すと、すべてのタスクのブロッ"
"クが同時に解除されます。"
msgid ""
"When a waiting or blocked task in the barrier is cancelled, this task exits "
"the barrier which stays in the same state. If the state of the barrier is "
"\"filling\", the number of waiting task decreases by 1."
msgstr ""
"バリアで待機中またはブロック中のタスクがキャンセルされると、そのタスクはバリ"
"アから抜けます。\n"
"バリアの状態は変わりません。\n"
"バリアが \"filling\" 状態の場合、待機中のタスク数は 1 減ります。"
msgid ""
"The return value is an integer in the range of 0 to ``parties-1``, different "
"for each task. This can be used to select a task to do some special "
"housekeeping, e.g.::"
msgstr ""
"戻り値は 0 から ``parties-1`` までの整数で、タスクごとに異なります。\n"
"これを使うと、後片付けなどの特別な処理を行うタスクを選べます。\n"
"例えば次のようにします。 ::"
msgid ""
"...\n"
"async with barrier as position:\n"
" if position == 0:\n"
" # Only one task prints this\n"
" print('End of *draining phase*')"
msgstr ""
"...\n"
"async with barrier as position:\n"
" if position == 0:\n"
" # 1 つのタスクだけがこれを表示する\n"
" print('End of *draining phase*')"
msgid ""
"This method may raise a :class:`BrokenBarrierError` exception if the barrier "
"is broken or reset while a task is waiting. It could raise "
"a :exc:`CancelledError` if a task is cancelled."
msgstr ""
"タスクの待機中にバリアが broken 状態になるかリセットされる"
"と、:class:`BrokenBarrierError` が送出される場合があります。\n"
"タスクがキャンセルされると :exc:`CancelledError` が送出される場合があります。"
msgid ""
"Return the barrier to the default, empty state. Any tasks waiting on it "
"will receive the :class:`BrokenBarrierError` exception."
msgstr ""
"バリアをデフォルトの空の状態に戻します。\n"
"バリアで待機しているタスクには :class:`BrokenBarrierError` が送出されます。"
msgid ""
"If a barrier is broken it may be better to just leave it and create a new "
"one."
msgstr ""
"バリアが broken 状態になった場合は、そのバリアをそのままにして新しく作り直す"
"方がよいこともあります。"
msgid ""
"Put the barrier into a broken state. This causes any active or future calls "
"to :meth:`~Barrier.wait` to fail with the :class:`BrokenBarrierError`. Use "
"this for example if one of the tasks needs to abort, to avoid infinite "
"waiting tasks."
msgstr ""
"バリアを broken 状態にします。\n"
"これにより、実行中および今後の :meth:`~Barrier.wait` の呼び出し"
"は :class:`BrokenBarrierError` で失敗します。\n"
"例えば、いずれかのタスクが処理を中断する必要があるときに、他のタスクが無限に"
"待機しないようにするために使います。"
msgid "The number of tasks required to pass the barrier."
msgstr "バリアを通過するために必要なタスク数です。"
msgid "The number of tasks currently waiting in the barrier while filling."
msgstr "filling 状態のバリアで現在待機しているタスク数です。"
#: ../../library/asyncio-sync.rst:460
msgid "A boolean that is ``True`` if the barrier is in the broken state."
msgstr "バリアが broken な状態である場合に ``True`` となるブール値。"
#: ../../library/asyncio-sync.rst:465
msgid ""
"This exception, a subclass of :exc:`RuntimeError`, is raised when "
"the :class:`Barrier` object is reset or broken."
msgstr ""
":class:`Barrier` オブジェクトがリセットされるか broken な場合に、この例外 "
"(:exc:`RuntimeError` のサブクラス) が送出されます。"
#: ../../library/asyncio-sync.rst:473
msgid ""
"Acquiring a lock using ``await lock`` or ``yield from lock`` and/"
"or :keyword:`with` statement (``with await lock``, ``with (yield from "
"lock)``) was removed. Use ``async with lock`` instead."
msgstr ""
"``await lock`` や ``yield from lock`` およびそれらと :keyword:`with` 文との組"
"み合わせ (すなわち ``with await lock`` や ``with (yield from lock)``) による"
"ロックの獲得は削除されました。代わりに ``async with lock`` を使ってください。"
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.