@@ -74,11 +74,11 @@ msgstr ""
7474
7575#: ../../library/threading.rst:43
7676msgid "Handle uncaught exception raised by :func:`Thread.run`."
77- msgstr ""
77+ msgstr "处理由 :func:`Thread.run` 引发的未捕获异常。 "
7878
7979#: ../../library/threading.rst:45
8080msgid "The *args* argument has the following attributes:"
81- msgstr ""
81+ msgstr "*args* 参数具有以下属性: "
8282
8383#: ../../library/threading.rst:47
8484msgid "*exc_type*: Exception type."
@@ -94,43 +94,46 @@ msgstr "*exc_traceback*: 异常回溯,可以是 ``None``."
9494
9595#: ../../library/threading.rst:50
9696msgid "*thread*: Thread which raised the exception, can be ``None``."
97- msgstr ""
97+ msgstr "*thread*: 引发异常的线程,可以为 ``None``。 "
9898
9999#: ../../library/threading.rst:52
100100msgid ""
101101"If *exc_type* is :exc:`SystemExit`, the exception is silently ignored. "
102102"Otherwise, the exception is printed out on :data:`sys.stderr`."
103103msgstr ""
104+ "如果 *exc_type* 为 :exc:`SystemExit`,则异常会被静默地忽略。 在其他情况下,异常将被打印到 "
105+ ":data:`sys.stderr`。"
104106
105107#: ../../library/threading.rst:55
106108msgid ""
107109"If this function raises an exception, :func:`sys.excepthook` is called to "
108110"handle it."
109- msgstr ""
111+ msgstr "如果此函数引发了异常,则会调用 :func:`sys.excepthook` 来处理它。 "
110112
111113#: ../../library/threading.rst:58
112114msgid ""
113115":func:`threading.excepthook` can be overridden to control how uncaught "
114116"exceptions raised by :func:`Thread.run` are handled."
115117msgstr ""
118+ ":func:`threading.excepthook` 可以被重载以控制由 :func:`Thread.run` 引发的未捕获异常的处理方式。"
116119
117120#: ../../library/threading.rst:61
118121msgid ""
119122"Storing *exc_value* using a custom hook can create a reference cycle. It "
120123"should be cleared explicitly to break the reference cycle when the exception"
121124" is no longer needed."
122- msgstr ""
125+ msgstr "使用定制钩子存放 *exc_value* 可能会创建引用循环。 它应当在不再需要异常时被显式地清空以打破引用循环。 "
123126
124127#: ../../library/threading.rst:65
125128msgid ""
126129"Storing *thread* using a custom hook can resurrect it if it is set to an "
127130"object which is being finalized. Avoid storing *thread* after the custom "
128131"hook completes to avoid resurrecting objects."
129- msgstr ""
132+ msgstr "使用定制钩子存放 *thread* 可能会在它设为被终结对象时将其重生。 请避免在定制钩子完成后存放 *thread* 以避免对象的重生。 "
130133
131134#: ../../library/threading.rst:70
132135msgid ":func:`sys.excepthook` handles uncaught exceptions."
133- msgstr ""
136+ msgstr ":func:`sys.excepthook` 处理未捕获的异常。 "
134137
135138#: ../../library/threading.rst:77
136139msgid ""
@@ -347,6 +350,8 @@ msgid ""
347350":func:`threading.excepthook` is called to handle it. By default, "
348351":func:`threading.excepthook` ignores silently :exc:`SystemExit`."
349352msgstr ""
353+ "如果 :meth:`~Thread.run` 方法引发了异常,则会调用 :func:`threading.excepthook` 来处理它。 "
354+ "在默认情况下,:func:`threading.excepthook` 会静默地忽略 :exc:`SystemExit`。"
350355
351356#: ../../library/threading.rst:232
352357msgid ""
@@ -551,18 +556,21 @@ msgid ""
551556"uniquely identify this particular thread system-wide (until the thread "
552557"terminates, after which the value may be recycled by the OS)."
553558msgstr ""
559+ "此线程的原生集成线程 ID。 这是一个非负整数,或者如果线程还未启动则为 ``None``。 请参阅 :func:`get_native_id` 函数。"
560+ " 这表示线程 ID (``TID``) 已被 OS (内核) 赋值给线程。 "
561+ "它的值可能被用来在全系统范围内唯一地标识这个特定线程(直到线程终结,在那之后该值可能会被 OS 回收再利用)。"
554562
555563#: ../../library/threading.rst:362
556564msgid ""
557565"Similar to Process IDs, Thread IDs are only valid (guaranteed unique system-"
558566"wide) from the time the thread is created until the thread has been "
559567"terminated."
560- msgstr ""
568+ msgstr "类似于进程 ID,线程 ID 的有效期(全系统范围内保证唯一)将从线程被创建开始直到线程被终结。 "
561569
562570#: ../../library/threading.rst:367
563571msgid ""
564572":ref:`Availability <availability>`: Requires :func:`get_native_id` function."
565- msgstr ""
573+ msgstr ":ref:`可用性 <availability>`: 需要 :func:`get_native_id` 函数。 "
566574
567575#: ../../library/threading.rst:372
568576msgid "Return whether the thread is alive."
@@ -1465,7 +1473,7 @@ msgid ""
14651473"Note that using this function may require some external synchronization if "
14661474"there are other threads whose state is unknown. If a barrier is broken it "
14671475"may be better to just leave it and create a new one."
1468- msgstr ""
1476+ msgstr "请注意使用此函数时,如果存在状态未知的其他线程,则可能需要执行外部同步。 如果栅栏已损坏则最好将其废弃并新建一个。 "
14691477
14701478#: ../../library/threading.rst:1021
14711479msgid ""
@@ -1474,6 +1482,8 @@ msgid ""
14741482" example if one of the threads needs to abort, to avoid deadlocking the "
14751483"application."
14761484msgstr ""
1485+ "使栅栏处于损坏状态。 这将导致任何现有和未来对 :meth:`wait` 的调用失败并引发 :class:`BrokenBarrierError`。 "
1486+ "例如可以在需要中止某个线程时使用此方法,以避免应用程序的死锁。"
14771487
14781488#: ../../library/threading.rst:1026
14791489msgid ""
0 commit comments