summaryrefslogtreecommitdiff
path: root/x11/libX11/patches/patch-ah
diff options
context:
space:
mode:
Diffstat (limited to 'x11/libX11/patches/patch-ah')
-rw-r--r--x11/libX11/patches/patch-ah60
1 files changed, 0 insertions, 60 deletions
diff --git a/x11/libX11/patches/patch-ah b/x11/libX11/patches/patch-ah
deleted file mode 100644
index fbf72e43ae1..00000000000
--- a/x11/libX11/patches/patch-ah
+++ /dev/null
@@ -1,60 +0,0 @@
-$NetBSD: patch-ah,v 1.3 2008/07/24 01:07:31 bjs Exp $
-
---- src/XlibInt.c.orig 2008-07-23 01:53:49.000000000 -0400
-+++ src/XlibInt.c
-@@ -206,8 +206,6 @@ static char *_XAsyncReply(
- Bool discard);
- #endif /* !USE_XCB */
-
--#define SEQLIMIT (65535 - (BUFSIZE / SIZEOF(xReq)) - 10)
--
- /*
- * The following routines are internal routines used by Xlib for protocol
- * packet transmission and reception.
-@@ -570,24 +568,34 @@ _XWaitForReadable(
- }
- #endif /* !USE_XCB */
-
-+static int sync_hazard(Display *dpy)
-+{
-+ unsigned long span = dpy->request - dpy->last_request_read;
-+ unsigned long hazard = min((dpy->bufmax - dpy->buffer) / SIZEOF(xReq), 65535 - 10);
-+ return span >= 65535 - hazard - 10;
-+}
-+
- static
- int _XSeqSyncFunction(
- register Display *dpy)
- {
- xGetInputFocusReply rep;
- register xReq *req;
-+ int sent_sync = 0;
-
- LockDisplay(dpy);
-- if ((dpy->request - dpy->last_request_read) >= (BUFSIZE / SIZEOF(xReq))) {
-+ if ((dpy->request - dpy->last_request_read) >= (65535 - BUFSIZE/SIZEOF(xReq))) {
- GetEmptyReq(GetInputFocus, req);
- (void) _XReply (dpy, (xReply *)&rep, 0, xTrue);
-+ sent_sync = 1;
- }
- /* could get XID handler while waiting for reply in MT env */
-- if (dpy->synchandler == _XSeqSyncFunction) {
-+ if (dpy->synchandler == _XSeqSyncFunction && !sync_hazard(dpy)) {
- dpy->synchandler = dpy->savedsynchandler;
- dpy->flags &= ~XlibDisplayPrivSync;
- }
- UnlockDisplay(dpy);
-+ if (sent_sync)
- SyncHandle();
- return 0;
- }
-@@ -595,8 +603,7 @@ int _XSeqSyncFunction(
- void _XSetSeqSyncFunction(
- register Display *dpy)
- {
-- if ((dpy->request - dpy->last_request_read) >= SEQLIMIT &&
-- !(dpy->flags & XlibDisplayPrivSync)) {
-+ if (!(dpy->flags & XlibDisplayPrivSync) && sync_hazard(dpy)) {
- dpy->savedsynchandler = dpy->synchandler;
- dpy->synchandler = _XSeqSyncFunction;
- dpy->flags |= XlibDisplayPrivSync;