Commit 5df21b2e authored by Rod Vagg's avatar Rod Vagg
Browse files

deps: backport 9a4fd268 from libuv upstream

Original commit message:

    win: redo/fix the uv_rwlock APIs

    Previously, on Windows Vista and later, we'd use the Windows native
    SRWLock APIs. However they turned out to be semantically incompatible
    with pthread read-write locks and/or plain buggy. This patch makes sure
    that the custom implementation that was previously only used on old
    Windows versions is now used everywhere.

    This patch fixes a number of issues with the old fallback
    implementation. Specifically:

    * The reader count would not be incremented when a thread successfully
      acquired a read lock while another thread *also* held a read lock.

    * `uv_rwlock_tryrdlock()` and `uv_rwlock_trywrlock()` now
      consistently return UV_EBUSY when a lock couldn't be acquired.

    * Any unexpected errors now cause libuv to abort, with the exception of
      `uv_rwlock_init()`.

    See also https://github.com/libuv/libuv/issues/515.

    PR-URL: https://github.com/libuv/libuv/pull/525


Reviewed-By: default avatarSaúl Ibarra Corretgé <saghul@gmail.com>

PR-URL: https://github.com/nodejs/node-private/pull/54


Reviewed-By: default avatarSaúl Ibarra Corretgé <saghul@gmail.com>
parent e75de350
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment