aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2024-12-06 19:41:35 +0100
committerCorinna Vinschen <corinna@vinschen.de>2024-12-06 19:41:35 +0100
commit376fe1dab17791238f57fa6d071d3600651dead0 (patch)
tree86efbb03fe6409d8fd38d8a9b1a27d7a270667c0
parentad919e053555964e585527789924c89f10257cfe (diff)
downloadnewlib-376fe1dab17791238f57fa6d071d3600651dead0.zip
newlib-376fe1dab17791238f57fa6d071d3600651dead0.tar.gz
newlib-376fe1dab17791238f57fa6d071d3600651dead0.tar.bz2
Cygwin: cygthread: stop running all cygthreads at HIGHEST priority.
Given the number of scenarios we're using cygthreads, it just doesn't make sense to run all of them with HIGHEST priority in preemptive obedience. Drop setting the cygthread priority and let the cygthreads decide by themselves. For the time being, run all cygthreads with normal priority. Change this locally in the thread function, if required. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
-rw-r--r--winsup/cygwin/cygthread.cc5
-rw-r--r--winsup/cygwin/sigproc.cc1
2 files changed, 4 insertions, 2 deletions
diff --git a/winsup/cygwin/cygthread.cc b/winsup/cygwin/cygthread.cc
index bd2ca55..97df216 100644
--- a/winsup/cygwin/cygthread.cc
+++ b/winsup/cygwin/cygthread.cc
@@ -271,7 +271,10 @@ cygthread::async_create (ULONG_PTR arg)
{
cygthread *that = (cygthread *) arg;
that->create ();
- ::SetThreadPriority (that->h, THREAD_PRIORITY_HIGHEST);
+ /* We used to set the priority to HIGHEST here, but most cygthreads don't
+ require such a high priority. Keep the priority at NORMAL here and let
+ the thread function decide by itself if it needs a higher or lower
+ priority, based on the task it performs. */
that->zap_h ();
}
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index c4c1595..59b4208 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -1345,7 +1345,6 @@ wait_sig (VOID *)
hntdll = GetModuleHandle ("ntdll.dll");
- SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_NORMAL);
for (;;)
{
DWORD nb;