threadsSetLockFunctions

Allows the application to replace the standard method that GDK uses to protect its data structures. Normally, GDK creates a single glib.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.

More...
void
threadsSetLockFunctions

Parameters

enterFn GCallback

function called to guard GDK

leaveFn GCallback

function called to release the guard

Detailed Description

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

Meta