summaryrefslogtreecommitdiff
path: root/src/PutBEvent.c
diff options
context:
space:
mode:
authorEgbert Eich <eich@freedesktop.org>2004-08-31 11:37:03 +0000
committerEgbert Eich <eich@freedesktop.org>2004-08-31 11:37:03 +0000
commit2d3afb68a104a80a21ee622b9abb9c95e83505d3 (patch)
tree98d56bd26998e173fc6b6dc138eb83a9c824cb31 /src/PutBEvent.c
parente689746c8d0e21e9011e8b91a3071d235d3a2a74 (diff)
Fixed some lockups in XIM code when the application is running with multi thread support. These lockups occur deep down in XFilterEvents() which itself locks when another Xlib function gets called that also locks. This fixes two instances by separating those Xlib functions into an internal (non-locking) call and a locking wrapper that is used as an external function. There may be several other such instances therefore another more general patch is eventually required (Bugzilla #1182).XORG-6_8_1
Diffstat (limited to 'src/PutBEvent.c')
-rw-r--r--src/PutBEvent.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/PutBEvent.c b/src/PutBEvent.c
index 2260359f..c8499360 100644
--- a/src/PutBEvent.c
+++ b/src/PutBEvent.c
@@ -33,16 +33,14 @@ from The Open Group.
#include "Xlibint.h"
int
-XPutBackEvent (dpy, event)
- register Display *dpy;
- register XEvent *event;
+_XPutBackEvent (
+ register Display *dpy,
+ register XEvent *event)
{
register _XQEvent *qelt;
- LockDisplay(dpy);
if (!dpy->qfree) {
if ((dpy->qfree = (_XQEvent *) Xmalloc (sizeof (_XQEvent))) == NULL) {
- UnlockDisplay(dpy);
return 0;
}
dpy->qfree->next = NULL;
@@ -56,6 +54,18 @@ XPutBackEvent (dpy, event)
if (dpy->tail == NULL)
dpy->tail = qelt;
dpy->qlen++;
- UnlockDisplay(dpy);
return 0;
}
+
+int
+XPutBackEvent (
+ register Display * dpy,
+ register XEvent *event)
+ {
+ int ret;
+
+ LockDisplay(dpy);
+ ret = _XPutBackEvent(dpy, event);
+ UnlockDisplay(dpy);
+ return ret;
+ }