# TSRM mutex return value inconsitencies

- Thread: https://externals.io/message/35185
- Original archive: https://news-web.php.net/php.internals/35185
- Started by Scott MacVicar on 2008-02-05T13:50:45+00:00
- Messages: 4
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #35185 — Scott MacVicar — 2008-02-05T13:50:45+00:00

URL: https://externals.io/message/35185#35185

Hi,

While doing some threaded work I noticed that tsrm_mutex_lock and 
tsrm_mutex_unlock return different values for Windows and Linux (using 
pthread).

Attached is the patch to make everything more pthread like, it will 
return 0 for success and any other value is an error.

Windows, GNU Portable Threads and the NSAPI implementations were 
returning incorrect values.

Scott

---

## #35237 — Dmitry Stogov — 2008-02-06T10:58:44+00:00

URL: https://externals.io/message/35185#35237 · In reply to: #35185

Hi Scott,

I'm fine with your patch.
Please commit it, or let me know if you like me to commit it.

Thanks. Dmitry.

Scott MacVicar wrote:
> Hi,
> 
> While doing some threaded work I noticed that tsrm_mutex_lock and
> tsrm_mutex_unlock return different values for Windows and Linux (using
> pthread).
> 
> Attached is the patch to make everything more pthread like, it will
> return 0 for success and any other value is an error.
> 
> Windows, GNU Portable Threads and the NSAPI implementations were
> returning incorrect values.
> 
> Scott

---

## #35247 — Scott MacVicar — 2008-02-06T13:13:32+00:00

URL: https://externals.io/message/35185#35247 · In reply to: #35237

Hi Dmitry,

I don't have karma for TSRM only php-src.

Scott

Dmitry Stogov wrote:
> Hi Scott,
> 
> I'm fine with your patch.
> Please commit it, or let me know if you like me to commit it.
> 
> Thanks. Dmitry.
> 
> Scott MacVicar wrote:
> > […]

---

## #35289 — Antony Dovgal — 2008-02-07T10:50:25+00:00

URL: https://externals.io/message/35185#35289 · In reply to: #35247

> Hi Dmitry,
> 
> I don't have karma for TSRM only php-src.

Patch committed, thanks a lot.

Ilia, should I commit it to 5_2?
This looks more like a regular bugfix, not as an improvement.

-- 
Wbr, 
Antony Dovgal
