FROMLIST: binder: use inner lock to sync work dq and node counts
authorTodd Kjos <tkjos@google.com>
Tue, 21 Mar 2017 20:06:01 +0000 (13:06 -0700)
committerTodd Kjos <tkjos@google.com>
Thu, 13 Jul 2017 15:34:21 +0000 (08:34 -0700)
commite7f23ede6e9c92adb4d7b6fd143d838ea5440e92
tree784307e7c3602d16cc93f22d53d0ce63475d42db
parentfc7a7e2064b153bb5033a68872f5744029540b41
FROMLIST: binder: use inner lock to sync work dq and node counts

(from https://patchwork.kernel.org/patch/9817789/)

For correct behavior we need to hold the inner lock when
dequeuing and processing node work in binder_thread_read.
We now hold the inner lock when we enter the switch statement
and release it after processing anything that might be
affected by other threads.

We also need to hold the inner lock to protect the node
weak/strong ref tracking fields as long as node->proc
is non-NULL (if it is NULL then we are guaranteed that
we don't have any node work queued).

This means that other functions that manipulate these fields
must hold the inner lock. Refactored these functions to use
the inner lock.

Change-Id: I90cb6e39a3fecf4809a0828aa3a4f3199b38b209
Signed-off-by: Todd Kjos <tkjos@google.com>
drivers/android/binder.c