mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 02:28:10 +02:00
vulkan/wsi: fix possible random stalls in wsi_display_wait_for_event
pthread_cond_broadcast man page says this:
"The pthread_cond_broadcast() or pthread_cond_signal() functions may
be called by a thread whether or not it currently owns the mutex that
threads calling pthread_cond_wait() or pthread_cond_timedwait() have
associated with the condition variable during their waits; however,
if predictable scheduling behavior is required, then that mutex shall
be locked by the thread calling pthread_cond_broadcast() or
pthread_cond_signal()."
Found by reading the code.
Compile tested only.
Fixes: da997ebec9 ("vulkan: Add KHR_display extension using DRM [v10]")
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7197>
This commit is contained in:
parent
85053c016c
commit
4408131142
1 changed files with 1 additions and 1 deletions
|
|
@ -1210,8 +1210,8 @@ wsi_display_wait_thread(void *data)
|
|||
if (ret > 0) {
|
||||
pthread_mutex_lock(&wsi->wait_mutex);
|
||||
(void) drmHandleEvent(wsi->fd, &event_context);
|
||||
pthread_mutex_unlock(&wsi->wait_mutex);
|
||||
pthread_cond_broadcast(&wsi->wait_cond);
|
||||
pthread_mutex_unlock(&wsi->wait_mutex);
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue