History log of /libuv/src/win/thread.c (Results 1 – 25 of 47)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# abc97670 25-Mar-2024 Saúl Ibarra Corretgé

win: simplify uv_once implementation

* win: simplify uv_once implementation

InitOnceExecuteOnce is available in Windows >= Vista.

Ref: https://learn.microsoft.com/en-us/win

win: simplify uv_once implementation

* win: simplify uv_once implementation

InitOnceExecuteOnce is available in Windows >= Vista.

Ref: https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-initonceexecuteonce

show more ...


# 964f79f7 06-Mar-2023 Jameson Nash

barrier: wait for prior out before next in (#3905)

This code would previously get confused between rounds of the barrier
being called and a thread might incorrectly get stuck (deadlock)

barrier: wait for prior out before next in (#3905)

This code would previously get confused between rounds of the barrier
being called and a thread might incorrectly get stuck (deadlock) if the
next round started before that thread had exited the current round.

Avoid that by not starting the next round in++ before out-- has reached
zero indicating that all threads have left the prior round.

And fix it that on Windows by replacing the implementation with the one
from unix. There are some awkward platform-specific redirection here
with an extra malloc that is not needed on Win32, but that will be fixed
in libuv v2.

Fixes: https://github.com/libuv/libuv/issue/3872

show more ...


# 64669fdd 15-Nov-2022 daomingq

thread: add uv_thread_getcpu() (#3803)

Add uv_thread_getcpu() api to get the cpu number on which the calling
thread is running.


# e9000066 21-Oct-2022 daomingq

thread: add support for affinity (#3774)

Backported thread affinity feature and related dependency commits
from master. It will add support for those APIs: uv_cpumask_size,
uv_thread

thread: add support for affinity (#3774)

Backported thread affinity feature and related dependency commits
from master. It will add support for those APIs: uv_cpumask_size,
uv_thread_setaffinity, uv_thread_getaffinity.
The supported platforms are Linux, Freebsd, and Windows.
Empty implementations (returning UV_ENOTSUP) on non-supported platforms
(such as OS X and AIX).

show more ...


# cdced3a3 31-Jan-2022 ssrlive <30760636+ssrlive@users.noreply.github.com>

thread,win: fix C90 style nit (#3393)


# a3e02e5e 12-Jan-2022 David Machaj <46852402+dmachaj@users.noreply.github.com>

win: replace CRITICAL_SECTION+Semaphore with SRWLock (#3383)

Fixes: https://github.com/libuv/libuv/issues/3382


# 40bf9a89 25-Nov-2021 Jameson Nash

thread: initialize uv_thread_self for all threads (#3357)

In particular, previously the main thread would have an id of NULL,
which was then not valid to use with any other API that expe

thread: initialize uv_thread_self for all threads (#3357)

In particular, previously the main thread would have an id of NULL,
which was then not valid to use with any other API that expected a
uv_thread_t handle.

show more ...


Revision tags: v1.41.0, v1.40.0, v1.39.0, v1.38.1, v1.38.0, v1.37.0, v1.36.0, v1.35.0, v1.34.2, v1.34.1, v1.34.0, v1.33.1, v1.33.0, v1.32.0, v1.31.0, v1.30.1, v1.30.0, v1.29.1, v1.29.0, v1.28.0, v1.27.0, v1.26.0
# 0eca049a 06-Feb-2019 Anna Henningsen

thread: allow specifying stack size for new thread

PR-URL: https://github.com/libuv/libuv/pull/2179
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé

thread: allow specifying stack size for new thread

PR-URL: https://github.com/libuv/libuv/pull/2179
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>

show more ...

Revision tags: v1.25.0, v1.24.1
# ee48e6e4 15-Nov-2018 Jameson Nash

thread,mingw64: need intrin.h header for SSE2 MemoryBarrier

Needed for compile with `-msse2` (such as implied by `-march=pentium4`)
for the i686-w64-mingw64 target triple. This seems lik

thread,mingw64: need intrin.h header for SSE2 MemoryBarrier

Needed for compile with `-msse2` (such as implied by `-march=pentium4`)
for the i686-w64-mingw64 target triple. This seems like a header mistake, but
we can work-around it here by including the header explicitly.

Refs: https://sourceforge.net/p/mingw-w64/bugs/712
PR-URL: https://github.com/libuv/libuv/pull/2083
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>

show more ...

Revision tags: v1.24.0, v1.23.2, v1.23.1, v1.23.0, v1.22.0, v1.21.0
# 672b96fa 01-Jun-2018 Carlo Marcelo Arenas Belón

win: remove req.c and other cleanup

PR-URL: https://github.com/libuv/libuv/pull/2018
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com

win: remove req.c and other cleanup

PR-URL: https://github.com/libuv/libuv/pull/2018
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

show more ...

# e1f505f8 14-Jun-2018 Ben Noordhuis

win: fix -Wunused-function warnings in thread.c

PR-URL: https://github.com/libuv/libuv/pull/1882
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Colin Ihrig <c

win: fix -Wunused-function warnings in thread.c

PR-URL: https://github.com/libuv/libuv/pull/1882
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

show more ...

# 36cdc134 14-Jun-2018 Ben Noordhuis

win: fix mingw build error

`UV__UNUSED()` does not evaluate to nothing with MinGW, use something
else instead to squelch the unused argument warning.

PR-URL: https://github.com/

win: fix mingw build error

`UV__UNUSED()` does not evaluate to nothing with MinGW, use something
else instead to squelch the unused argument warning.

PR-URL: https://github.com/libuv/libuv/pull/1882
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

show more ...

# 13e8b15e 28-May-2018 Bert Belder

win,thread: remove fallback uv_cond implementation

The fallback implementation existed to support Windows XP and Server 2003,
but these old versions of windows are no longer supporter by

win,thread: remove fallback uv_cond implementation

The fallback implementation existed to support Windows XP and Server 2003,
but these old versions of windows are no longer supporter by libuv.

PR-URL: https://github.com/libuv/libuv/pull/1852
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

show more ...

# 9584df25 29-May-2018 Bert Belder

src,test: fix idiosyncratic comment style

Back in the day I wrote comments in a really unusual way. Nowadays it
makes my eyes bleed, and clang-format doesn't know how to deal with it.

src,test: fix idiosyncratic comment style

Back in the day I wrote comments in a really unusual way. Nowadays it
makes my eyes bleed, and clang-format doesn't know how to deal with it.

PR-URL: https://github.com/libuv/libuv/pull/1853
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>

show more ...

Revision tags: v1.20.3, v1.20.2, v1.20.1, v1.20.0, v1.19.2, v1.19.1, v1.19.0, v1.18.0, v1.17.0
# 50706207 19-Nov-2017 Ben Noordhuis

win: issue memory barrier in uv_thread_join()

I'm 99% sure `WaitForSingleObject()` already issues a memory barrier for
thread objects but since I could find no mention of that on MSDN, l

win: issue memory barrier in uv_thread_join()

I'm 99% sure `WaitForSingleObject()` already issues a memory barrier for
thread objects but since I could find no mention of that on MSDN, let's
play it safe and do it ourselves, too.

PR-URL: https://github.com/libuv/libuv/pull/1634
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

show more ...

Revision tags: v1.16.1, v1.16.0, v1.15.0
# ec96b554 21-Sep-2017 Scott Parker

unix,win: add uv_mutex_init_recursive()

Support the creation of recursive mutexes on Unix. A matching
API is added on Windows, however mutexes on Windows are always
recursive.

unix,win: add uv_mutex_init_recursive()

Support the creation of recursive mutexes on Unix. A matching
API is added on Windows, however mutexes on Windows are always
recursive.

Refs: https://github.com/libuv/libuv/issues/1022
PR-URL: https://github.com/libuv/libuv/pull/1555
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

show more ...

Revision tags: v1.14.1, v1.14.0, v1.13.1, v1.13.0, v1.12.0, v1.11.0, v1.10.2, v1.10.1, v1.10.0, v0.10.37, v1.9.1, v1.9.0, v1.8.0, v1.7.5
# 98239224 17-Sep-2015 Bert Belder

win: don't fetch function pointers to SRWLock APIs

They're no longer needed, since the Windows-native SRWLock functions are
no longer used.

PR-URL: https://github.com/libuv/libu

win: don't fetch function pointers to SRWLock APIs

They're no longer needed, since the Windows-native SRWLock functions are
no longer used.

PR-URL: https://github.com/libuv/libuv/pull/525
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>

show more ...

# 9a4fd268 12-Sep-2015 Bert Belder

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 pthrea

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: Saúl Ibarra Corretgé <saghul@gmail.com>

show more ...

# bd1777fd 21-Sep-2015 Saúl Ibarra Corretgé

unix, win: consolidate mutex trylock errors

Fold EAGAIN into EBUSY, and make it the only acceptable error.

PR-URL: https://github.com/libuv/libuv/pull/535
Reviewed-By: Ben Noord

unix, win: consolidate mutex trylock errors

Fold EAGAIN into EBUSY, and make it the only acceptable error.

PR-URL: https://github.com/libuv/libuv/pull/535
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>

show more ...

Revision tags: v1.7.4
# 3eb6764a 10-Sep-2015 Bert Belder

win: fix unsavory rwlock fallback implementation

Before this patch an uv_mutex_t (backed by a critical section) could be
released by a tread different from the thread that acquired it, w

win: fix unsavory rwlock fallback implementation

Before this patch an uv_mutex_t (backed by a critical section) could be
released by a tread different from the thread that acquired it, which is
not allowed. This is fixed by using a semaphore instead.

Note that the affected code paths were used on Windows XP and Windows
Server 2003 only.

Fixes: https://github.com/libuv/libuv/issues/515
PR-URL: https://github.com/libuv/libuv/pull/516
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>

show more ...

Revision tags: v1.7.3, v1.7.2, v1.7.1, v1.7.0
# a979e76e 01-Jul-2015 Saúl Ibarra Corretgé

win: fix returning thread id in uv_thread_self

The main thread does not have the thread id TLS created.

Fixes: https://github.com/joyent/node/issues/25602
PR-URL: https://github

win: fix returning thread id in uv_thread_self

The main thread does not have the thread id TLS created.

Fixes: https://github.com/joyent/node/issues/25602
PR-URL: https://github.com/libuv/libuv/pull/418
Reviewed-By: Alexis Campailla <alexis@janeasystems.com>
Reviewed-By: Bert Belder <bertbelder@gmail.com>

show more ...

Revision tags: v1.6.1, v1.6.0
# bddd6a84 26-May-2015 Saúl Ibarra Corretgé

core: add ability to customize memory allocator

This patch is composed by the work done in
https://github.com/libuv/libuv/pull/231 and
https://github.com/libuv/libuv/pull/287 plus so

core: add ability to customize memory allocator

This patch is composed by the work done in
https://github.com/libuv/libuv/pull/231 and
https://github.com/libuv/libuv/pull/287 plus some changes by yours
truly.

Thanks @beevik and @mattsta for their work on this!

PR-URL: https://github.com/libuv/libuv/pull/368
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>

show more ...

Revision tags: v1.5.0
# 1f711e4d 29-Apr-2015 Saúl Ibarra Corretgé

Revert "memory: add uv_replace_allocator"

This reverts commit c272f1f1bc0bda625e6441d798c110b4064a6ce2.

The concept will come back to libuv, but it needs some more work.

# c272f1f1 26-Feb-2015 Brett Vickers

memory: add uv_replace_allocator

With uv_replace_allocator, it's possible to override the default
memory allocator's malloc and free calls with functions of the user's
choosing. This

memory: add uv_replace_allocator

With uv_replace_allocator, it's possible to override the default
memory allocator's malloc and free calls with functions of the user's
choosing. This allows libuv to interoperate with projects requiring a
custom memory allocator.

Internally, all calls to malloc and free have been replaced with
uv__malloc and uv__free, respectively. The uv__malloc and uv__free
functions call malloc and free unless they have been overridden by a
previous call to uv_replace_allocator.

As part of this change, the special aligned memory allocations
performed in src/win/fs-event.c have been replaced with standard
allocations. The 4-byte alignment being requested in this file was
unnecessary, since standard allocators already guarantee at least an
8-byte alignment.

PR-URL: https://github.com/libuv/libuv/pull/231
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>

show more ...

Revision tags: v0.10.36, v1.4.2, v0.10.35, v1.4.1, v0.10.34
# ff031681 14-Feb-2015 Ben Noordhuis

unix,windows: make uv_thread_create() return errno

Before this commit, UNIX returned -1 on failure. Windows sometimes
returned a UV_E* error code and sometimes a bogus status code, cour

unix,windows: make uv_thread_create() return errno

Before this commit, UNIX returned -1 on failure. Windows sometimes
returned a UV_E* error code and sometimes a bogus status code, courtesy
of errno values not mapping to UV_E* error codes on that platform.

PR-URL: https://github.com/libuv/libuv/pull/204
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>

show more ...

12