[Xcb-commit] 2 commits - xcb
Jamey Sharp
jamey at kemper.freedesktop.org
Fri Sep 22 01:25:07 PDT 2006
xcb/src/xcb_in.c | 18 ++++++++++++------
xcb/tools/api_conv.pl | 2 +-
2 files changed, 13 insertions(+), 7 deletions(-)
New commits:
diff-tree 184e7a4c56db40e5b87c4c47f963f20519db2e1e (from 74247cfa112613167d450eeb0187f77f39a117ac)
Author: Jamey Sharp <jamey at minilop.net>
Date: Thu Sep 21 12:13:37 2006 -0700
Refactor XCBPollForEvent with a shorter critical section.
This simplifies the patch for bug #8208 later.
diff --git a/xcb/src/xcb_in.c b/xcb/src/xcb_in.c
index d4dbb3f..eab8b1d 100644
--- a/xcb/src/xcb_in.c
+++ b/xcb/src/xcb_in.c
@@ -380,21 +380,27 @@ XCBGenericEvent *XCBWaitForEvent(XCBConn
XCBGenericEvent *XCBPollForEvent(XCBConnection *c, int *error)
{
XCBGenericEvent *ret = 0;
+ int success;
pthread_mutex_lock(&c->iolock);
- if(error)
- *error = 0;
/* FIXME: follow X meets Z architecture changes. */
- if(_xcb_in_read(c))
+ success = _xcb_in_read(c);
+ if(success)
ret = get_event(c);
- else if(error)
+ pthread_mutex_unlock(&c->iolock);
+ if(success)
+ {
+ if(error)
+ *error = 0;
+ return ret;
+ }
+ if(error)
*error = -1;
else
{
fprintf(stderr, "XCBPollForEvent: I/O error occured, but no handler provided.\n");
abort();
}
- pthread_mutex_unlock(&c->iolock);
- return ret;
+ return 0;
}
XCBGenericError *XCBRequestCheck(XCBConnection *c, XCBVoidCookie cookie)
diff-tree 74247cfa112613167d450eeb0187f77f39a117ac (from 2afa71474201d627b108325024a38fd580010329)
Author: Jamey Sharp <jamey at minilop.net>
Date: Mon Sep 18 16:52:00 2006 -0700
XCB*Id is a variable, not a type: adjust API conventions accordingly.
diff --git a/xcb/tools/api_conv.pl b/xcb/tools/api_conv.pl
index 2e6a1d0..a780ac3 100755
--- a/xcb/tools/api_conv.pl
+++ b/xcb/tools/api_conv.pl
@@ -42,7 +42,7 @@ sub convert($$)
return "XCB" . uc($_) if $const;
- $_ .= "_t" unless $fun;
+ $_ .= "_t" unless $fun or /_id$/;
return "xcb" . $_;
}
More information about the xcb-commit
mailing list