Unit Instance
Units API.
See the Weblate's Web API documentation for detailed description of the API.
GET /api/units/1811655/?format=api
{ "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "This requires one to take special care when using an item protected by atomic instructions. For example, in the sleep mutex implementation, we have to use an `atomic_cmpset` rather than an `atomic_set` to turn on the `MTX_CONTESTED` bit. The reason is that we read the value of `mtx_lock` into a variable and then make a decision based on that read. However, the value we read may be stale, or it may change while we are making our decision. Thus, when the `atomic_set` executed, it may end up setting the bit on another value than the one we made the decision on. Thus, we have to use an `atomic_cmpset` to set the value only if the value we made the decision on is up-to-date and valid." ], "previous_source": "", "target": [ "Это требует особой осторожности при использовании элемента, защищённого атомарными инструкциями. Например, в реализации мьютекса сна мы должны использовать `atomic_cmpset` вместо `atomic_set` для установки бита `MTX_CONTESTED`. Причина в том, что мы считываем значение `mtx_lock` в переменную и затем принимаем решение на основе этого чтения. Однако значение, которое мы ранее прочитали, может быть устаревшим или измениться, пока мы принимаем решение. Таким образом, когда выполняется `atomic_set`, это может привести к установке бита на другом значении, отличном от того, на котором мы основывали своё решение. Поэтому мы должны использовать `atomic_cmpset`, чтобы установить значение только в том случае, если значение, на котором мы приняли решение, актуально и действительно." ], "id_hash": 3413074382387017462, "content_hash": 3413074382387017462, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:74", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 11, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 125, "source_unit": "https://translate-dev.freebsd.org/api/units/1134182/?format=api", "priority": 100, "id": 1811655, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=af5dad114a29f6f6", "url": "https://translate-dev.freebsd.org/api/units/1811655/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.196962Z" }