diff options
author | Peter Harris <pharris@opentext.com> | 2009-11-19 16:46:18 -0800 |
---|---|---|
committer | Peter Harris <pharris@opentext.com> | 2009-11-19 16:46:18 -0800 |
commit | d4c9119f37f68448d6cce7a1439d0de66a7cb920 (patch) | |
tree | 75531b3f26e70c1df30e8fd2e988abcf72cf5fca | |
parent | eeaa853904aa33b4ab7e9b5008a31a83b08872e8 (diff) |
Lock private while populatingprivate
-rw-r--r-- | renderutil/cache.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/renderutil/cache.c b/renderutil/cache.c index 787fc99..bb7225b 100644 --- a/renderutil/cache.c +++ b/renderutil/cache.c @@ -144,11 +144,14 @@ find_display (xcb_connection_t *c) /* * get private */ - info = xcb_private_get(c, private_id); + info = xcb_private_get_and_lock(c, private_id); if (!info) return NULL; - if (info->version) + if (info->version) { + /* Already populated */ + xcb_private_unlock(info); return info; + } version_cookie = xcb_render_query_version(c, 0, 10); formats_cookie = xcb_render_query_pict_formats(c); @@ -168,6 +171,7 @@ find_display (xcb_connection_t *c) else if (info->version->major_version == 0 && info->version->minor_version < 6) info->formats->num_subpixel = 0; + xcb_private_unlock(info); return info; } |