@@ -11,7 +11,7 @@ msgid ""
11
11
msgstr ""
12
12
"Project-Id-Version : Python 3.14\n "
13
13
"Report-Msgid-Bugs-To : \n "
14
- "POT-Creation-Date : 2025-06-27 14:20 +0000\n "
14
+ "POT-Creation-Date : 2025-07-25 14:21 +0000\n "
15
15
"PO-Revision-Date : 2025-07-18 18:48+0000\n "
16
16
"Last-Translator : Rafael Fontenelle <rffontenelle@gmail.com>, 2025\n "
17
17
"Language-Team : Portuguese (Brazil) (https://app.transifex.com/python-doc/ "
@@ -3299,19 +3299,30 @@ msgid ""
3299
3299
"issue a fatal error."
3300
3300
msgstr ""
3301
3301
3302
- #: ../../c-api/init.rst:2447
3302
+ #: ../../c-api/init.rst:2446
3303
+ msgid "Returns non-zero if the mutex *m* is currently locked, zero otherwise."
3304
+ msgstr ""
3305
+
3306
+ #: ../../c-api/init.rst:2450
3307
+ msgid ""
3308
+ "This function is intended for use in assertions and debugging only and "
3309
+ "should not be used to make concurrency control decisions, as the lock state "
3310
+ "may change immediately after the check."
3311
+ msgstr ""
3312
+
3313
+ #: ../../c-api/init.rst:2459
3303
3314
msgid "Python Critical Section API"
3304
3315
msgstr ""
3305
3316
3306
- #: ../../c-api/init.rst:2449
3317
+ #: ../../c-api/init.rst:2461
3307
3318
msgid ""
3308
3319
"The critical section API provides a deadlock avoidance layer on top of per-"
3309
3320
"object locks for :term:`free-threaded <free threading>` CPython. They are "
3310
3321
"intended to replace reliance on the :term:`global interpreter lock`, and are "
3311
3322
"no-ops in versions of Python with the global interpreter lock."
3312
3323
msgstr ""
3313
3324
3314
- #: ../../c-api/init.rst:2454
3325
+ #: ../../c-api/init.rst:2466
3315
3326
msgid ""
3316
3327
"Critical sections avoid deadlocks by implicitly suspending active critical "
3317
3328
"sections and releasing the locks during calls to :c:func:"
@@ -3321,15 +3332,24 @@ msgid ""
3321
3332
"-- they are useful because their behavior is similar to the :term:`GIL`."
3322
3333
msgstr ""
3323
3334
3324
- #: ../../c-api/init.rst:2461
3335
+ #: ../../c-api/init.rst:2473
3336
+ msgid ""
3337
+ "Variants that accept :c:type:`PyMutex` pointers rather than Python objects "
3338
+ "are also available. Use these variants to start a critical section in a "
3339
+ "situation where there is no :c:type:`PyObject` -- for example, when working "
3340
+ "with a C type that does not extend or wrap :c:type:`PyObject` but still "
3341
+ "needs to call into the C API in a manner that might lead to deadlocks."
3342
+ msgstr ""
3343
+
3344
+ #: ../../c-api/init.rst:2479
3325
3345
msgid ""
3326
3346
"The functions and structs used by the macros are exposed for cases where C "
3327
3347
"macros are not available. They should only be used as in the given macro "
3328
3348
"expansions. Note that the sizes and contents of the structures may change in "
3329
3349
"future Python versions."
3330
3350
msgstr ""
3331
3351
3332
- #: ../../c-api/init.rst:2468
3352
+ #: ../../c-api/init.rst:2486
3333
3353
msgid ""
3334
3354
"Operations that need to lock two objects at once must use :c:macro:"
3335
3355
"`Py_BEGIN_CRITICAL_SECTION2`. You *cannot* use nested critical sections to "
@@ -3338,11 +3358,11 @@ msgid ""
3338
3358
"lock more than two objects at once."
3339
3359
msgstr ""
3340
3360
3341
- #: ../../c-api/init.rst:2474
3361
+ #: ../../c-api/init.rst:2492
3342
3362
msgid "Example usage::"
3343
3363
msgstr "Exemplo de uso::"
3344
3364
3345
- #: ../../c-api/init.rst:2476
3365
+ #: ../../c-api/init.rst:2494
3346
3366
msgid ""
3347
3367
"static PyObject *\n"
3348
3368
"set_field(MyObject *self, PyObject *value)\n"
@@ -3354,7 +3374,7 @@ msgid ""
3354
3374
"}"
3355
3375
msgstr ""
3356
3376
3357
- #: ../../c-api/init.rst:2485
3377
+ #: ../../c-api/init.rst:2503
3358
3378
msgid ""
3359
3379
"In the above example, :c:macro:`Py_SETREF` calls :c:macro:`Py_DECREF`, which "
3360
3380
"can call arbitrary code through an object's deallocation function. The "
@@ -3364,61 +3384,100 @@ msgid ""
3364
3384
"`PyEval_SaveThread`."
3365
3385
msgstr ""
3366
3386
3367
- #: ../../c-api/init.rst:2493
3387
+ #: ../../c-api/init.rst:2511
3368
3388
msgid ""
3369
3389
"Acquires the per-object lock for the object *op* and begins a critical "
3370
3390
"section."
3371
3391
msgstr ""
3372
3392
3373
- #: ../../c-api/init.rst:2496 ../../c-api/init.rst:2510
3374
- #: ../../c-api/init.rst:2525 ../../c-api/init.rst:2539
3393
+ #: ../../c-api/init.rst:2514 ../../c-api/init.rst:2528
3394
+ #: ../../c-api/init.rst:2545 ../../c-api/init.rst:2560
3395
+ #: ../../c-api/init.rst:2574 ../../c-api/init.rst:2591
3375
3396
msgid "In the free-threaded build, this macro expands to::"
3376
3397
msgstr ""
3377
3398
3378
- #: ../../c-api/init.rst:2498
3399
+ #: ../../c-api/init.rst:2516
3379
3400
msgid ""
3380
3401
"{\n"
3381
3402
" PyCriticalSection _py_cs;\n"
3382
3403
" PyCriticalSection_Begin(&_py_cs, (PyObject*)(op))"
3383
3404
msgstr ""
3384
3405
3385
- #: ../../c-api/init.rst:2502 ../../c-api/init.rst:2531
3406
+ #: ../../c-api/init.rst:2520 ../../c-api/init.rst:2566
3386
3407
msgid "In the default build, this macro expands to ``{``."
3387
3408
msgstr ""
3388
3409
3389
- #: ../../c-api/init.rst:2508
3410
+ #: ../../c-api/init.rst:2526
3411
+ msgid "Locks the mutex *m* and begins a critical section."
3412
+ msgstr ""
3413
+
3414
+ #: ../../c-api/init.rst:2530
3415
+ msgid ""
3416
+ "{\n"
3417
+ " PyCriticalSection _py_cs;\n"
3418
+ " PyCriticalSection_BeginMutex(&_py_cs, m)"
3419
+ msgstr ""
3420
+
3421
+ #: ../../c-api/init.rst:2534
3422
+ msgid ""
3423
+ "Note that unlike :c:macro:`Py_BEGIN_CRITICAL_SECTION`, there is no cast for "
3424
+ "the argument of the macro - it must be a :c:type:`PyMutex` pointer."
3425
+ msgstr ""
3426
+
3427
+ #: ../../c-api/init.rst:2537 ../../c-api/init.rst:2583
3428
+ msgid "On the default build, this macro expands to ``{``."
3429
+ msgstr ""
3430
+
3431
+ #: ../../c-api/init.rst:2543
3390
3432
msgid "Ends the critical section and releases the per-object lock."
3391
3433
msgstr ""
3392
3434
3393
- #: ../../c-api/init.rst:2512
3435
+ #: ../../c-api/init.rst:2547
3394
3436
msgid ""
3395
3437
" PyCriticalSection_End(&_py_cs);\n"
3396
3438
"}"
3397
3439
msgstr ""
3398
3440
3399
- #: ../../c-api/init.rst:2515 ../../c-api/init.rst:2544
3441
+ #: ../../c-api/init.rst:2550 ../../c-api/init.rst:2596
3400
3442
msgid "In the default build, this macro expands to ``}``."
3401
3443
msgstr ""
3402
3444
3403
- #: ../../c-api/init.rst:2521
3445
+ #: ../../c-api/init.rst:2556
3404
3446
msgid ""
3405
3447
"Acquires the per-objects locks for the objects *a* and *b* and begins a "
3406
3448
"critical section. The locks are acquired in a consistent order (lowest "
3407
3449
"address first) to avoid lock ordering deadlocks."
3408
3450
msgstr ""
3409
3451
3410
- #: ../../c-api/init.rst:2527
3452
+ #: ../../c-api/init.rst:2562
3411
3453
msgid ""
3412
3454
"{\n"
3413
3455
" PyCriticalSection2 _py_cs2;\n"
3414
3456
" PyCriticalSection2_Begin(&_py_cs2, (PyObject*)(a), (PyObject*)(b))"
3415
3457
msgstr ""
3416
3458
3417
- #: ../../c-api/init.rst:2537
3459
+ #: ../../c-api/init.rst:2572
3460
+ msgid "Locks the mutexes *m1* and *m2* and begins a critical section."
3461
+ msgstr ""
3462
+
3463
+ #: ../../c-api/init.rst:2576
3464
+ msgid ""
3465
+ "{\n"
3466
+ " PyCriticalSection2 _py_cs2;\n"
3467
+ " PyCriticalSection2_BeginMutex(&_py_cs2, m1, m2)"
3468
+ msgstr ""
3469
+
3470
+ #: ../../c-api/init.rst:2580
3471
+ msgid ""
3472
+ "Note that unlike :c:macro:`Py_BEGIN_CRITICAL_SECTION2`, there is no cast for "
3473
+ "the arguments of the macro - they must be :c:type:`PyMutex` pointers."
3474
+ msgstr ""
3475
+
3476
+ #: ../../c-api/init.rst:2589
3418
3477
msgid "Ends the critical section and releases the per-object locks."
3419
3478
msgstr ""
3420
3479
3421
- #: ../../c-api/init.rst:2541
3480
+ #: ../../c-api/init.rst:2593
3422
3481
msgid ""
3423
3482
" PyCriticalSection2_End(&_py_cs2);\n"
3424
3483
"}"
0 commit comments