• Similar to the fixes for subscriber, without holding the waiter_lock_,
    updating the waiting_done_ flag may cause deadlock. In the deadlock
    example below, Thread1 is waiting for the response, thread 2 is
    processing the response and updating the waiter_lock_ variable:
    
    ----------------------------------------------------
    |        Thread 1          |       Thread 2        |
    ----------------------------------------------------
    | locks 'waiter_lock_'     |                       |
    | check 'waiting_done_'    |                       |
    |                          | Update 'waiting done' |
    |                          | Send notification     |
    | begin waiting for signal |                       |
    | *deadlocked*             |                       |
    ----------------------------------------------------
    Collin Hockey authored
     
    Browse Code »