Main problem is not bitmap creation but many operations on off screen bitmap.
First I would like to find out what is current status and if it could be achieved in same way as with winapi. I consider using customdraw as "last resort" solution. My application is pretty complex with modular system and many threads.
I found this code in gtk2 implementation:
{$IFDEF EnabledGtkThreading}
{$IFNDEF Win32}
GtkThread := g_thread_self();
if GtkThread <> nil then
begin
if GtkThread^.data = nil then
GtkThread^.data := @Self
else
FIsLibraryInstance := True;
end;
if GetThreadManager(TM{%H-}) and Assigned(TM.InitManager) and g_thread_supported then
begin
g_thread_init(nil);
{$IFDEF USE_GTK_MAIN_OLD_ITERATION}
gdk_threads_init;
gdk_threads_enter;
{$ENDIF}
fMultiThreadingEnabled := True;
end;
{$ELSE}
g_thread_init(nil);
{$ENDIF}
{$ENDIF}
Combination of gdk_threads_enter and gdk_threads_leave is probably official solution but is not used by default in LCL gtk2 widgetset implementation. There is MultiThreadingEnabled property which is in fact not used elsewhere. I tried to guard canvas operations with gdk_threads_enter and gdk_threads_leave and drawing nearly worked but random exceptions occurred. So it was not useful solution. And ifdef gtk2 would be needed for that.
I attached updated demo app with gtk locking which is not working reliably.