Commit Graph

56 Commits

Author SHA1 Message Date
Alexandre Julliard e3001b6a7c configure: Assume that sys/mman.h is available on Unix.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-09 18:43:51 +01:00
Matteo Bruni e86b4015ff ntdll: Call usleep() instead of NtYieldExecution() in NtDelayExecution().
This implements the general fix from
b1a79c6b9c (in particular, making sure
that Sleep(0) will not immediately resume execution of the thread if
there are no other runnable threads) while preserving the existing
behavior of NtYieldExecution() / SwitchToThread(). Thanks Rémi for the
idea.

Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-22 22:20:50 +01:00
Matteo Bruni 3203f05668 Revert "ntdll: Implement NtYieldExecution() as usleep().".
Rémi found a regression caused by that patch. His analysis suggests
that it's probably correct for NtYieldExecution() to map to
sched_yield().

Let's revert the patch and fix the issue in a slightly different way.

This reverts commit b1a79c6b9c.

Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-22 22:20:50 +01:00
Alexandre Julliard 470ac022f2 ntdll: Fix a compiler warning on macOS.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-19 15:36:30 +01:00
Zebediah Figura f3e9498740 ntdll: Reimplement SRW locks on top of Win32 futexes.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-18 11:09:25 +01:00
Zebediah Figura 87164ee333 ntdll: Get rid of the direct futex path for condition variables.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-18 11:09:16 +01:00
Zebediah Figura c577ce2671 ntdll: Reimplement the critical section fast path on top of Win32 futexes.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-18 11:09:07 +01:00
Zebediah Figura 6bdb914a25 ntdll: Reimplement Win32 futexes on top of thread-ID alerts.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-18 11:08:49 +01:00
Zebediah Figura 842ecb45f4 ntdll: Implement thread-ID alerts using Mach semaphores on Mac.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-18 11:08:16 +01:00
Zebediah Figura 9d79f72142 ntdll: Implement thread-ID alerts using futexes if possible.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-17 17:59:26 +01:00
Zebediah Figura 0e931fa5fd ntdll: Implement NtAlertThreadByThreadId and NtWaitForAlertByThreadId.
These will be used to implement RtlWaitOnAddress() and other in-process
synchronization primitives, as they are on Windows.

These patches went through quite a few revisions in order to ensure that they
had sufficient performance and correctness compared to the current
implementation. I am particularly grateful to Etienne Juvigny and Dmitry
Skvortsov for performing extensive testing.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-17 16:36:01 +01:00
Huw Davies 6fdae1979b configure: Stop checking for poll.h and sys/poll.h - always use poll.h.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-31 17:56:54 +01:00
Alexandre Julliard 832724282b ntdll: Avoid including wine/port.h.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-20 16:16:07 +02:00
Matteo Bruni b1a79c6b9c ntdll: Implement NtYieldExecution() as usleep().
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-07 18:03:11 +02:00
Alexandre Julliard 97479d3d32 ntdll: Move some exception definitions to winternl.h.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-07 13:52:42 +02:00
Gabriel Ivăncescu 2fe70331d9 ntdll: Implement JobObjectBasicProcessIdList for NtQueryInformationJobObject.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-14 21:24:14 +02:00
Francois Gouget d84e84c126 ntdll: Improve the Nt{Query,Set}TimerResolution() stubs.
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-02 22:57:38 +02:00
Alexandre Julliard 3fb4d1f779 ntdll: Always clear the returned handle in Nt object functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-23 17:38:32 +02:00
Alexandre Julliard d3df2b12ce server: Remove support for process-local handle tables.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-16 11:13:41 +01:00
Alexandre Julliard 7999af8244 ntdll: Implement NtWaitForDebugEvent().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-01 16:48:09 +01:00
Alexandre Julliard 7bebf7db8c ntdll: Implement NtSetInformationDebugObject().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-01 11:10:06 +01:00
Alexandre Julliard 964772bc8e ntdll: Support the NtCreateDebugObject() flags.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-29 12:34:46 +01:00
Alexandre Julliard 5ebc20c656 ntdll: Implement NtCreateDebugObject().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-27 11:23:11 +01:00
Daniel Lehman 6a971e8429 ntdll: Check event type on creation.
Signed-off-by: Daniel Lehman <dlehman25@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-21 20:46:13 +01:00
Erich E. Hoover 773b97bb2b ntdll: Fix converting large 32-bit time_t when time_t is signed.
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-24 22:09:30 +01:00
Alexandre Julliard d8f7d54573 ntdll: Add inline wrappers for pthread mutex locking.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-22 11:28:25 +02:00
Alexandre Julliard 0b3db9dfa2 ntdll: Handle page faults happening during a syscall without dispatching the exception.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-24 11:46:22 +02:00
Zebediah Figura 8bd95a80f2 ntdll: Read the condition variable and manipulate the lock on the PE side.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49712
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-24 11:17:04 +02:00
Alexandre Julliard 1d3e3a1c8d ntdll: Avoid importing RtlEnterCriticalSection/RtlLeaveCriticalSection from the Unix side.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-05 15:28:31 +02:00
Alexandre Julliard 2c903e9e9b ntdll: Move the critical section fallback code out of the Unix library.
This partially reverts commit ff19f21913.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-03 15:52:15 +02:00
Alexandre Julliard 78c772e9d8 ntdll: Use a syscall thunk for NtQueryPerformanceCounter().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-21 18:30:08 +02:00
Alexandre Julliard a47f4daf8f ntdll: Move the LPC port syscall stubs to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-20 17:58:12 +02:00
Alexandre Julliard e7c60141d6 ntdll: Move some timer stub functions to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 23:16:51 +02:00
Alexandre Julliard 0eae5d3abc ntdll: Move the atom system calls to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 23:16:51 +02:00
Alexandre Julliard 76e48978a9 ntdll: Move more object manager functions to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 23:16:51 +02:00
Alexandre Julliard 052e8dbf59 ntdll: Use a pthread mutex for the wait on address section.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-13 21:22:14 +02:00
Alexandre Julliard a07cff77d3 ntdll: Use malloc() to allocate the object attributes buffer.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-03 12:04:02 +02:00
Alexandre Julliard b8dc6b2412 ntdll: Move RtlGetSystemTimePrecise() to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-25 23:08:30 +02:00
Alexandre Julliard 07248fc500 ntdll: Move the job functions to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-13 13:46:01 +02:00
Alexandre Julliard 06fa3d32a7 ntdll: Move the IO completion functions to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-13 11:56:30 +02:00
Alexandre Julliard e0fca94511 ntdll: Move the directory functions to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-12 16:42:24 +02:00
Nikolay Sivov d4c2b61c48 ntdll: Fix a typo in security descriptor flags.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-11 21:03:31 +02:00
Alexandre Julliard a4ce2f652d ntdll: Move Nt system time functions to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-11 15:51:18 +02:00
Alexandre Julliard df513b95ec ntdll: Avoid referencing security descriptor functions from the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-10 08:50:35 +02:00
Alexandre Julliard ff19f21913 ntdll: Move the futex-based critical section implementation to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-09 21:23:33 +02:00
Alexandre Julliard 552bc8aa47 ntdll: Move the wait on address implementation to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-09 15:47:30 +02:00
Alexandre Julliard 509ad75adb ntdll: Move the futex-based condition variable implementation to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-09 15:47:30 +02:00
Alexandre Julliard 246dedaa09 ntdll: Move the futex-based SRW lock implementation to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-09 15:25:52 +02:00
Alexandre Julliard ca3ca7b046 ntdll: Move the rest of the thread creation code to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-05 14:25:36 +02:00
Alexandre Julliard cdfc45859c ntdll: Move the section object functions to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-04 22:36:39 +02:00