initial commit
Signed-off-by: Peter Siegmund <mars3142@noreply.mars3142.dev>
This commit is contained in:
40
libs/wxWidgets-3.3.1/include/wx/gtk/private/threads.h
Normal file
40
libs/wxWidgets-3.3.1/include/wx/gtk/private/threads.h
Normal file
@@ -0,0 +1,40 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk/private/threads.h
|
||||
// Purpose: Wrappers for GDK threads support.
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2022-09-23
|
||||
// Copyright: (c) 2022 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GTK_PRIVATE_THREADS_H_
|
||||
#define _WX_GTK_PRIVATE_THREADS_H_
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Redefine GDK functions to avoiding deprecation warnings
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxGCC_WARNING_SUPPRESS(deprecated-declarations)
|
||||
|
||||
static inline void wx_gdk_threads_enter() { gdk_threads_enter(); }
|
||||
#define gdk_threads_enter wx_gdk_threads_enter
|
||||
|
||||
static inline void wx_gdk_threads_leave() { gdk_threads_leave(); }
|
||||
#define gdk_threads_leave wx_gdk_threads_leave
|
||||
|
||||
wxGCC_WARNING_RESTORE(deprecated-declarations)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// RAII wrapper for acquiring/leaving GDK lock in ctor/dtor
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class wxGDKThreadsLock
|
||||
{
|
||||
public:
|
||||
wxGDKThreadsLock() { gdk_threads_enter(); }
|
||||
~wxGDKThreadsLock() { gdk_threads_leave(); }
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxGDKThreadsLock);
|
||||
};
|
||||
|
||||
#endif // _WX_GTK_PRIVATE_THREADS_H_
|
||||
Reference in New Issue
Block a user