x-synchronize

x-synchronize is a built-in function in `C source code'.

(x-synchronize ON &optional TERMINAL)

If ON is non-nil, report X errors as soon as the erring request is made.
This function only has an effect on X Windows. With MS Windows, it is
defined but does nothing.

If ON is nil, allow buffering of requests.
Turning on synchronization prohibits the Xlib routines from buffering
requests and seriously degrades performance, but makes debugging much
easier.
The optional second argument TERMINAL specifies which display to act on.
TERMINAL should be a terminal object, a frame or a display name (a string).
If TERMINAL is omitted or nil, that stands for the selected frame's display.