Warning: threads_enter is deprecated since 3.6.
This function marks the beginning of a critical section in which GDK and GTK+ functions can be called safely and without causing race conditions.
All GDK and GTK+ calls should be made from the main thread
Only one thread at a time can be in such a critial section.