mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-17 07:13:23 +01:00
fb6d590e50
working (the actual bug is in Java). svn path=/nixpkgs/trunk/; revision=8189
30 lines
849 B
Diff
30 lines
849 B
Diff
--- foo/src/xcb_xlib.c.orig 2006-11-25 22:03:30.000000000 +0000
|
|
+++ foo/src/xcb_xlib.c 2006-11-25 22:19:28.000000000 +0000
|
|
@@ -38,18 +38,20 @@
|
|
void xcb_xlib_lock(xcb_connection_t *c)
|
|
{
|
|
_xcb_lock_io(c);
|
|
- assert(!c->xlib.lock);
|
|
- c->xlib.lock = 1;
|
|
- c->xlib.thread = pthread_self();
|
|
+ if (!c->xlib.lock) {
|
|
+ c->xlib.lock = 1;
|
|
+ c->xlib.thread = pthread_self();
|
|
+ }
|
|
_xcb_unlock_io(c);
|
|
}
|
|
|
|
void xcb_xlib_unlock(xcb_connection_t *c)
|
|
{
|
|
_xcb_lock_io(c);
|
|
- assert(c->xlib.lock);
|
|
- assert(pthread_equal(c->xlib.thread, pthread_self()));
|
|
- c->xlib.lock = 0;
|
|
- pthread_cond_broadcast(&c->xlib.cond);
|
|
+ if (c->xlib.lock) {
|
|
+ assert(pthread_equal(c->xlib.thread, pthread_self()));
|
|
+ c->xlib.lock = 0;
|
|
+ pthread_cond_broadcast(&c->xlib.cond);
|
|
+ }
|
|
_xcb_unlock_io(c);
|
|
}
|