[doc-en] master: sem_get(): warn that auto_release also applies when the semaphore is freed (#5963)
| From: | qodelicious via GitHub | Date: | Mon, 19 Oct 2026 09:25:29 +0000 |
| Subject: | [doc-en] master: sem_get(): warn that auto_release also applies when the semaphore is freed (#5963) | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-23861@lists.php.net to get a copy of this message | ||
Author: qodelicious (qodelicious)
Committer: GitHub (web-flow)
Pusher: lacatoire
Date: 2026-10-19T11:25:26+02:00
Commit: https://github.com/php/doc-en/commit/e1ed939373254ebf51ed7822d1a700eb4abeb3a1
Raw diff: https://github.com/php/doc-en/commit/e1ed939373254ebf51ed7822d1a700eb4abeb3a1.diff
sem_get(): warn that auto_release also applies when the semaphore is freed (#5963)
* sem_get(): warn that auto_release also applies when the semaphore is freed
Fixes #3612
* Apply review suggestion
Changed paths:
M reference/sem/functions/sem-get.xml
Diff:
diff --git a/reference/sem/functions/sem-get.xml b/reference/sem/functions/sem-get.xml
index 01d99641a2a0..861251adc9c7 100644
--- a/reference/sem/functions/sem-get.xml
+++ b/reference/sem/functions/sem-get.xml
@@ -120,6 +120,15 @@
otherwise PHP will be unable to access the semaphore.
</simpara>
</warning>
+ <warning>
+ <simpara>
+ If <parameter>auto_release</parameter> is enabled, the acquisitions held by a
+ <classname>SysvSemaphore</classname> object are also released as soon as the
+ object is freed, for example when the variable holding it is unset,
+ overwritten or goes out of scope, not only on request shutdown. Keep a
+ reference to the object for as long as the semaphore needs to stay acquired.
+ </simpara>
+ </warning>
</refsect1>
<refsect1 role="seealso">