aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xquartz/xpr/xprFrame.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-05-16 09:49:27 +0000
committermarha <marha@users.sourceforge.net>2011-05-16 09:49:27 +0000
commitab5c2d2c78273ccdc7c9734bcba482a33fcf9652 (patch)
treed12aaeba9956621fe7429d94a7c90105fe306b42 /xorg-server/hw/xquartz/xpr/xprFrame.c
parent421ecdd3ee6f691c63c4568944423d986f9f69db (diff)
parent08cbf3b50bfe713044f36b363c73768cd042f13c (diff)
downloadvcxsrv-ab5c2d2c78273ccdc7c9734bcba482a33fcf9652.tar.gz
vcxsrv-ab5c2d2c78273ccdc7c9734bcba482a33fcf9652.tar.bz2
vcxsrv-ab5c2d2c78273ccdc7c9734bcba482a33fcf9652.zip
merge ^/branches/released .
Diffstat (limited to 'xorg-server/hw/xquartz/xpr/xprFrame.c')
-rw-r--r--xorg-server/hw/xquartz/xpr/xprFrame.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/xorg-server/hw/xquartz/xpr/xprFrame.c b/xorg-server/hw/xquartz/xpr/xprFrame.c
index e88019c2d..1d90d8a3d 100644
--- a/xorg-server/hw/xquartz/xpr/xprFrame.c
+++ b/xorg-server/hw/xquartz/xpr/xprFrame.c
@@ -69,7 +69,7 @@ static x_hash_table *window_hash;
#ifdef HAVE_LIBDISPATCH
static dispatch_queue_t window_hash_serial_q;
#else
-static pthread_mutex_t window_hash_mutex;
+static pthread_rwlock_t window_hash_rwlock;
#endif
/* Prototypes for static functions */
@@ -192,9 +192,9 @@ xprCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen,
x_hash_table_insert(window_hash, pFrame->wid, pFrame);
});
#else
- pthread_mutex_lock(&window_hash_mutex);
+ pthread_rwlock_wrlock(&window_hash_rwlock);
x_hash_table_insert(window_hash, pFrame->wid, pFrame);
- pthread_mutex_unlock(&window_hash_mutex);
+ pthread_rwlock_wrlock(&window_hash_rwlock);
#endif
xprSetNativeProperty(pFrame);
@@ -216,9 +216,9 @@ xprDestroyFrame(RootlessFrameID wid)
x_hash_table_remove(window_hash, wid);
});
#else
- pthread_mutex_lock(&window_hash_mutex);
+ pthread_rwlock_wrlock(&window_hash_rwlock);
x_hash_table_remove(window_hash, wid);
- pthread_mutex_unlock(&window_hash_mutex);
+ pthread_rwlock_unlock(&window_hash_rwlock);
#endif
err = xp_destroy_window(x_cvt_vptr_to_uint(wid));
@@ -292,9 +292,9 @@ static void xprRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid) {
winRec = x_hash_table_lookup(window_hash, wid, NULL);
});
#else
- pthread_mutex_lock(&window_hash_mutex);
+ pthread_rwlock_rdlock(&window_hash_rwlock);
winRec = x_hash_table_lookup(window_hash, wid, NULL);
- pthread_mutex_unlock(&window_hash_mutex);
+ pthread_rwlock_unlock(&window_hash_rwlock);
#endif
if(winRec) {
@@ -479,7 +479,7 @@ xprInit(ScreenPtr pScreen)
#ifdef HAVE_LIBDISPATCH
assert((window_hash_serial_q = dispatch_queue_create(BUNDLE_ID_PREFIX".X11.xpr_window_hash", NULL)));
#else
- assert(0 == pthread_mutex_init(&window_hash_mutex, NULL));
+ assert(0 == pthread_rwlock_init(&window_hash_rwlock, NULL));
#endif
return TRUE;
@@ -500,9 +500,9 @@ xprGetXWindow(xp_window_id wid)
});
#else
RootlessWindowRec *winRec;
- pthread_mutex_lock(&window_hash_mutex);
+ pthread_rwlock_rdlock(&window_hash_rwlock);
winRec = x_hash_table_lookup(window_hash, x_cvt_uint_to_vptr(wid), NULL);
- pthread_mutex_unlock(&window_hash_mutex);
+ pthread_rwlock_unlock(&window_hash_rwlock);
#endif
return winRec != NULL ? winRec->win : NULL;