Eliminate deadlock in trpc message handling
authorJennifer Richards <jennifer@painless-security.com>
Tue, 1 May 2018 17:49:24 +0000 (13:49 -0400)
committerJennifer Richards <jennifer@painless-security.com>
Tue, 1 May 2018 17:49:24 +0000 (13:49 -0400)
commitd3d9b0eb4b1718cad404236d589fff2f16de2c37
tree879b90dabbe75f8f06d072c46a69ab3844157351
parent74efd266be8e0672050401a890716cc089a2d609
Eliminate deadlock in trpc message handling

  * Remove notify_cb for the trpc thread's TR_MQ
  * Use trpc_mq_pop() directly in the tr_trpc_thread() instead of
    trying to empty the queue every time
  * Eliminate the complicated thread shutdown protocol needed to avoid
    invalid accesses to data allocated in tr_trpc_thread()

This eliminates a deadlock that was possible due to misuse of the
callback mutex in conjunction with the TR_MQ mutex.
common/tr_mq.c
include/tr_trp.h
include/trp_internal.h
tr/tr_trp.c
trp/trpc.c