[semidet]in_pce_thread_sync(:Goal)Same as in_pce_thread/1,
but wait for Goal to be completed. Success depends on the
success of executing Goal. Variable bindings inside Goal
are visible to the caller, but it should be noted that the values are
being copied. If Goal throws an exception, this
exception is re-thrown by in_pce_thread/1.
If the calling thread is the XPCE thread, in_pce_thread_sync/1
executes a direct meta-call. See also in_pce_thread/1.
Note that in_pce_thread_sync/1
is slow and is typically only required for operations that act on
windows or the display. A warning is printed if an SDL operation that
may only be called from the main thread is called from another thread.
Many common operations that require to be called in the main thread are
automatically proxied to the main thread.