FROMLIST: binder: don't modify thread->looper from other threads
authorTodd Kjos <tkjos@google.com>
Fri, 6 Jan 2017 22:19:25 +0000 (14:19 -0800)
committerTodd Kjos <tkjos@google.com>
Thu, 13 Jul 2017 15:34:19 +0000 (08:34 -0700)
commit6798e6dd2eaab3b36b5900904a73f71d33ee9f3f
tree4484163b7eea0d956962a6a70db39675ee4108c5
parent8dedb0ceb63df82fa8621fe8d79eea3908381e1b
FROMLIST: binder: don't modify thread->looper from other threads

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

The looper member of struct binder_thread is a bitmask
of control bits. All of the existing bits are modified
by the affected thread except for BINDER_LOOPER_STATE_NEED_RETURN
which can be modified in binder_deferred_flush() by
another thread.

To avoid adding a spinlock around all read-mod-writes to
modify a bit, the BINDER_LOOPER_STATE_NEED_RETURN flag
is replaced by a separate field in struct binder_thread.

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