threads_set_lock_functions


Description:


[ Version ( deprecated = true , deprecated_since = "3.6" , since = "2.4" ) ]
public void threads_set_lock_functions (Callback enter_fn, Callback leave_fn)

Warning: threads_set_lock_functions is deprecated since 3.6.

Allows the application to replace the standard method that GDK uses to protect its data structures.

Note:

All GDK and GTK+ calls should be made from the main thread

Normally, GDK creates a single Mutex that is locked by threads_enter, and released by threads_leave; using this function an application provides, instead, a function enter_fn that is called by threads_enter and a function leave_fn that is called by threads_leave.

The functions must provide at least same locking functionality as the default implementation, but can also do extra application specific processing.

As an example, consider an application that has its own recursive lock that when held, holds the GTK+ lock as well. When GTK+ unlocks the GTK+ lock when entering a recursive main loop, the application must temporarily release its lock as well.

Most threaded GTK+ apps won’t need to use this method.

This method must be called before threads_init, and cannot be called multiple times.

Parameters:

enter_fn

function called to guard GDK

leave_fn

function called to release the guard


Namespace: Gdk
Package: gdk-3.0



2022 vala-language.org