Merge pull request #23250 from tintou:./tintou/glib-req

highgui: Set hard GLib requirement to >=2.32
This commit is contained in:
Alexander Smorkalov 2023-03-21 15:22:34 +03:00 committed by GitHub
commit a4ff46aab7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 15 deletions

View File

@ -20,7 +20,7 @@ if(WITH_GTK)
endif()
endif()
endif()
ocv_check_modules(GTHREAD gthread-2.0)
ocv_check_modules(GTHREAD gthread-2.0>=2.32)
if(HAVE_GTK AND NOT HAVE_GTHREAD)
message(FATAL_ERROR "gthread not found. This library is required when building with GTK support")
else()

View File

@ -662,14 +662,6 @@ CV_IMPL int cvStartWindowThread(){
cvInitSystem(0,NULL);
if (!thread_started)
{
#if !GLIB_CHECK_VERSION(2, 32, 0) // https://github.com/GNOME/glib/blame/b4d58a7105bb9d75907233968bb534b38f9a6e43/glib/deprecated/gthread.h#L274
if (!g_thread_supported ())
{
/* the GThread system wasn't inited, so init it */
g_thread_init(NULL);
}
#endif
(void)getWindowMutex(); // force mutex initialization
// protects the 'last key pressed' variable
@ -678,13 +670,7 @@ CV_IMPL int cvStartWindowThread(){
// conditional that indicates a key has been pressed
cond_have_key = g_cond_new();
#if !GLIB_CHECK_VERSION(2, 32, 0)
// this is the window update thread
window_thread = g_thread_create(icvWindowThreadLoop,
NULL, TRUE, NULL);
#else
window_thread = g_thread_new("OpenCV window update", icvWindowThreadLoop, NULL);
#endif
}
thread_started = window_thread!=NULL;
return thread_started;