diff options
author | tnn <tnn> | 2016-05-04 02:48:27 +0000 |
---|---|---|
committer | tnn <tnn> | 2016-05-04 02:48:27 +0000 |
commit | 9f906272762674dbce7c0df2fda47624eead08cd (patch) | |
tree | 46ef802328db415c8573dd2f73e5d69c8304435f /x11 | |
parent | 879465653e7a6a03d5371c99b129186ea4e3b0d4 (diff) | |
download | pkgsrc-9f906272762674dbce7c0df2fda47624eead08cd.tar.gz |
move variable declarations to top of function
Diffstat (limited to 'x11')
-rw-r--r-- | x11/libxshmfence/files/xshmfence_semaphore.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/x11/libxshmfence/files/xshmfence_semaphore.c b/x11/libxshmfence/files/xshmfence_semaphore.c index 666f7c1f57e..3a9401805e9 100644 --- a/x11/libxshmfence/files/xshmfence_semaphore.c +++ b/x11/libxshmfence/files/xshmfence_semaphore.c @@ -51,15 +51,16 @@ static sem_t *mksemtemp(char *, const char *); **/ int xshmfence_trigger(struct xshmfence *f) { + int v, waiting; LOCK(); - int v = __sync_bool_compare_and_swap(&f->triggered, 0, 1); + v = __sync_bool_compare_and_swap(&f->triggered, 0, 1); if (v == 0) { /* already triggered */ UNLOCK(); return 0; } - int waiting = __sync_fetch_and_add(&f->waiting, 0); + waiting = __sync_fetch_and_add(&f->waiting, 0); while (waiting > 0) { COND_SIGNAL(); |