Changeset 91c38f8


Ignore:
Timestamp:
03/15/10 15:44:12 (11 years ago)
Author:
Perry Lorier <perry@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
7fc0eaa2
Parents:
9d6452b
Message:

Fix possible deadlock

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/iow-lzo.c

    r9d6452b r91c38f8  
    260260                        &tdata->outbuf);
    261261
     262                pthread_mutex_lock(&tdata->mutex);
    262263                tdata->state = FULL;
    263264                pthread_cond_signal(&tdata->out_ready);
    264                 pthread_mutex_lock(&tdata->mutex);
    265265        }
    266266        pthread_mutex_unlock(&tdata->mutex);
     
    433433                          ||get_next_thread(iow)->inbuf.offset >= MAX_BLOCK_SIZE) {
    434434                                get_next_thread(iow)->state = WAITING;
     435                                pthread_cond_signal(&get_next_thread(iow)->in_ready);
    435436                                pthread_mutex_unlock(&get_next_thread(iow)->mutex);
    436                                 pthread_cond_signal(&get_next_thread(iow)->in_ready);
    437437
    438438                                DATA(iow)->next_thread =
     
    475475        /* Now the thread should be empty, so ask it to shut down */
    476476        thread->closing = true;
     477        pthread_cond_signal(&thread->in_ready);
    477478        pthread_mutex_unlock(&thread->mutex);
    478         pthread_cond_signal(&thread->in_ready);
    479479        /* And wait for it to die */
    480480        pthread_join(thread->thread,NULL);
Note: See TracChangeset for help on using the changeset viewer.