Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cc417fa

Browse files
[po] auto sync
1 parent a8ac76e commit cc417fa

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

.stat.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"translation": "93.32%", "updated_at": "2024-01-24T03:55:56Z"}
1+
{"translation": "93.33%", "updated_at": "2024-01-24T07:55:48Z"}

c-api/init.po

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1299,13 +1299,18 @@ msgid ""
12991299
" are done, you should reset the thread state pointer, release the GIL, and "
13001300
"finally free the thread state data structure."
13011301
msgstr ""
1302+
"如果你需要从这些线程调用 Python 代码(这通常会是上述第三方库所提供的回调 API "
1303+
"的一部分),你必须首先通过创建线程状态数据结构体向解释器注册这些线程,然后获取 GIL,最后存储它们的线程状态指针,这样你才能开始使用 Python/C"
1304+
" API。 完成以上步骤后,你应当重置线程状态指针,释放 GIL,最后释放线程状态数据结构体。"
13021305

13031306
#: ../../c-api/init.rst:945
13041307
msgid ""
13051308
"The :c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release` functions "
13061309
"do all of the above automatically. The typical idiom for calling into "
13071310
"Python from a C thread is::"
13081311
msgstr ""
1312+
":c:func:`PyGILState_Ensure` 和 :c:func:`PyGILState_Release` 函数会自动完成上述的所有操作。 从"
1313+
" C 线程调用到 Python 的典型方式如下::"
13091314

13101315
#: ../../c-api/init.rst:959
13111316
msgid ""
@@ -1315,10 +1320,13 @@ msgid ""
13151320
":c:func:`Py_NewInterpreter`), but mixing multiple interpreters and the "
13161321
"``PyGILState_*`` API is unsupported."
13171322
msgstr ""
1323+
"请注意 ``PyGILState_*`` 函数会假定只有一个全局解释器(由 :c:func:`Py_Initialize` 自动创建)。 Python "
1324+
"支持创建额外的解释器(使用 :c:func:`Py_NewInterpreter` 创建),但不支持混合使用多个解释器和 "
1325+
"``PyGILState_*`` API。"
13181326

13191327
#: ../../c-api/init.rst:969
13201328
msgid "Cautions about fork()"
1321-
msgstr ""
1329+
msgstr "有关 fork() 的注意事项"
13221330

13231331
#: ../../c-api/init.rst:971
13241332
msgid ""
@@ -1328,6 +1336,9 @@ msgid ""
13281336
"concrete impact both on how locks must be handled and on all stored state in"
13291337
" CPython's runtime."
13301338
msgstr ""
1339+
"有关线程的另一个需要注意的重要问题是它们在面对 C :c:func:`fork` 调用时的行为。 在大多数支持 :c:func:`fork` "
1340+
"的系统中,当一个进程执行 fork 之后将只有发出 fork 的线程存在。 这对需要如何处理锁以及CPython "
1341+
"的运行时内所有的存储状态都会有实质性的影响。"
13311342

13321343
#: ../../c-api/init.rst:977
13331344
msgid ""

0 commit comments

Comments
 (0)