lock

fnvoid lock() nothrow @nogc

Acquires the FLTK lock for thread-safe operations.

Call this before accessing FLTK from a non-main thread. Must be paired with unlock().

Example:

// In worker thread:
lock();
scope(exit) unlock();
// Safe to modify widgets here
button.label = "Updated";