From: Jinoh Kang <jinoh.kang.kr(a)gmail.com> Fixes: f768d6b31bebc35fbaf751d0cd57c8bd302a8d60 --- libs/fluidsynth/glib.c | 10 +++++++--- libs/fluidsynth/glib.h | 3 ++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/libs/fluidsynth/glib.c b/libs/fluidsynth/glib.c index 8266ac4bda1..5756583111a 100644 --- a/libs/fluidsynth/glib.c +++ b/libs/fluidsynth/glib.c @@ -56,9 +56,9 @@ void g_usleep( unsigned int micros ) static DWORD CALLBACK g_thread_wrapper( void *args ) { GThread *thread = args; - gpointer ret = thread->func( thread->data ); + thread->result = thread->func( thread->data ); g_thread_unref( thread ); - return (UINT_PTR)ret; + return 0; } GThread *g_thread_try_new( const char *name, GThreadFunc func, gpointer data, GError **err ) @@ -88,10 +88,14 @@ void g_thread_unref( GThread *thread ) } } -void g_thread_join( GThread *thread ) +gpointer g_thread_join( GThread *thread ) { + gpointer result; + WaitForSingleObject( thread->handle, INFINITE ); + result = thread->result; g_thread_unref( thread ); + return result; } void g_clear_error( GError **error ) diff --git a/libs/fluidsynth/glib.h b/libs/fluidsynth/glib.h index 3ff3a962fab..950ce684c19 100644 --- a/libs/fluidsynth/glib.h +++ b/libs/fluidsynth/glib.h @@ -59,6 +59,7 @@ typedef struct HANDLE handle; GThreadFunc func; gpointer data; + gpointer result; } GThread; extern int g_vsnprintf( char *buffer, size_t size, const char *format, va_list args ) __WINE_CRT_PRINTF_ATTR(3, 0); @@ -69,7 +70,7 @@ extern void g_usleep( unsigned int micros ); extern GThread *g_thread_try_new( const char *name, GThreadFunc func, gpointer data, GError **err ); extern void g_thread_unref( GThread *thread ); -extern void g_thread_join( GThread *thread ); +extern gpointer g_thread_join( GThread *thread ); extern void g_clear_error( GError **error ); #define G_FILE_TEST_EXISTS 1 -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9023