Browse Source

Fix locking error and remove entries from jp linked lists

master
Con Kolivas 11 years ago
parent
commit
3cfe315b05
  1. 6
      src/stratifier.c

6
src/stratifier.c

@ -2104,10 +2104,12 @@ static void *share_processor(void *arg)
if (jp)
discard_json_params(&jp);
mutex_lock(&sauth_lock);
mutex_lock(&sshare_lock);
if (!sshares)
pthread_cond_wait(&sshare_cond, &sshare_lock);
jp = sshares;
if (likely(jp))
DL_DELETE(sshares, jp);
mutex_unlock(&sshare_lock);
if (unlikely(!jp))
@ -2154,6 +2156,8 @@ static void *authoriser(void *arg)
if (!sauths)
pthread_cond_wait(&sauth_cond, &sauth_lock);
jp = sauths;
if (likely(jp))
DL_DELETE(sauths, jp);
mutex_unlock(&sauth_lock);
if (unlikely(!jp))

Loading…
Cancel
Save