patch 9.1.1748: macOS: Default scheduler priority too low

Commit: 
https://github.com/vim/vim/commit/4bf0f6c1df70447156855dcaadbdab889bf99bb6
Author: Luna Razzaghipour <l...@xoria.org>
Date:   Wed Sep 10 03:55:51 2025 -0400

    patch 9.1.1748: macOS: Default scheduler priority too low
    
    Problem:  macOS: Default scheduler priority too low
    Solution: Explicitly set TASK_DEFAULT_APPLICATION scheduler priority
              to improve responsiveness (Luna Razzaghipour).
    
    closes: #18120
    
    Signed-off-by: Luna Razzaghipour <l...@xoria.org>
    Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/runtime/doc/version9.txt b/runtime/doc/version9.txt
index adb9bedd0..c7f725bad 100644
--- a/runtime/doc/version9.txt
+++ b/runtime/doc/version9.txt
@@ -1,4 +1,4 @@
-*version9.txt*  For Vim version 9.1.  Last change: 2025 Sep 09
+*version9.txt*  For Vim version 9.1.  Last change: 2025 Sep 10
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -41621,6 +41621,7 @@ Platform specific~
 - The Win32 GUI comes with better toolbar icons.
 
 - Better fullscreen support for Haiku |os_haiku.txt|.
+
                                                        *new-other-9.2*
 Other new features ~
 ------------------
@@ -41763,6 +41764,7 @@ Others: ~
 Platform specific ~
 - MS-Winodws: Paths like "\Windows" and "/Windows" are now considered to be
   absolute paths (to the current drive) and no longer relative.
+- macOS: increase default scheduler priority to TASK_DEFAULT_APPLICATION.
 
                                                        *added-9.2*
 Added ~
diff --git a/runtime/doc/vi_diff.txt b/runtime/doc/vi_diff.txt
index cf977380c..94ae22610 100644
--- a/runtime/doc/vi_diff.txt
+++ b/runtime/doc/vi_diff.txt
@@ -1,4 +1,4 @@
-*vi_diff.txt*   For Vim version 9.1.  Last change: 2025 Sep 08
+*vi_diff.txt*   For Vim version 9.1.  Last change: 2025 Sep 10
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -1381,7 +1381,7 @@ System                            | Status:~
 Amiga (OS4, AROS & MorphOS):   | still supported (?)
 Haiku:                         | supported
 Linux:                         | fully supported (on maintained versions)
-Mac OS:                                | fully supported up until v10.6 (?)
+macOS:                         | fully supported up until v10.6 (?)
 MS-Windows 7, 8, 10, 11:       | fully supported
 OpenVMS:                       | supported
 QNX:                           | still supported (?)
diff --git a/src/os_mac.h b/src/os_mac.h
index 34fe1f14c..6c23f4cb6 100644
--- a/src/os_mac.h
+++ b/src/os_mac.h
@@ -46,6 +46,11 @@
 #include <time.h>
 #include <dirent.h>
 
+/*
+ * Mach interface
+ */
+#include <mach/task.h>
+
 /*
  * MacOS specific #define
  */
diff --git a/src/os_unix.c b/src/os_unix.c
index 109489939..47c24b107 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -3676,6 +3676,15 @@ mch_early_init(void)
     signal_stack = alloc(get_signal_stack_size());
     init_signal_stack();
 #endif
+
+    /*
+     * Inform the macOS scheduler that Vim renders UI, and so shouldn’t have 
its
+     * threads’ quality of service classes clamped.
+     */
+#ifdef MACOS_X
+    integer_t policy = TASK_DEFAULT_APPLICATION;
+    task_policy_set(mach_task_self(), TASK_CATEGORY_POLICY, &policy, 1);
+#endif
 }
 
 #if defined(EXITFREE) || defined(PROTO)
diff --git a/src/version.c b/src/version.c
index 44eb6d961..85ccf3fa8 100644
--- a/src/version.c
+++ b/src/version.c
@@ -724,6 +724,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1748,
 /**/
     1747,
 /**/

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1uwFkN-00FAfo-Nv%40256bit.org.

Raspunde prin e-mail lui