GThread - Inherit parent thread priority by default for new Win32 threads

This is the default behaviour on POSIX and having different behaviour
between the two GThread implementations could lead to subtle problems.
This commit is contained in:
Sebastian Dröge
2019-09-17 17:27:50 +03:00
parent 9ed4b813e5
commit be537d8b51
2 changed files with 57 additions and 7 deletions

View File

@@ -833,6 +833,14 @@ g_thread_proxy (gpointer data)
* To free the struct returned by this function, use g_thread_unref().
* Note that g_thread_join() implicitly unrefs the #GThread as well.
*
* New threads by default inherit their scheduler policy (POSIX) or thread
* priority (Windows) of the thread creating the new thread.
*
* This behaviour changed in GLib 2.64: before threads on Windows were not
* inheriting the thread priority but were spawned with the default priority.
* Starting with GLib 2.64 the behaviour is now consistent between Windows and
* POSIX and all threads inherit their parent thread's priority.
*
* Returns: the new #GThread
*
* Since: 2.32