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) if (jp)
discard_json_params(&jp); discard_json_params(&jp);
mutex_lock(&sauth_lock); mutex_lock(&sshare_lock);
if (!sshares) if (!sshares)
pthread_cond_wait(&sshare_cond, &sshare_lock); pthread_cond_wait(&sshare_cond, &sshare_lock);
jp = sshares; jp = sshares;
if (likely(jp))
DL_DELETE(sshares, jp);
mutex_unlock(&sshare_lock); mutex_unlock(&sshare_lock);
if (unlikely(!jp)) if (unlikely(!jp))
@ -2154,6 +2156,8 @@ static void *authoriser(void *arg)
if (!sauths) if (!sauths)
pthread_cond_wait(&sauth_cond, &sauth_lock); pthread_cond_wait(&sauth_cond, &sauth_lock);
jp = sauths; jp = sauths;
if (likely(jp))
DL_DELETE(sauths, jp);
mutex_unlock(&sauth_lock); mutex_unlock(&sauth_lock);
if (unlikely(!jp)) if (unlikely(!jp))

Loading…
Cancel
Save