commit | 986eaa7b7628ccb1ba510999f8e191ef368f2d7a | [log] [tgz] |
---|---|---|
author | Hugo Benichi <hugobenichi@google.com> | Wed May 31 15:31:59 2017 +0900 |
committer | Hugo Benichi <hugobenichi@google.com> | Wed May 31 15:35:54 2017 +0900 |
tree | 7bbc82e7999fb9c1fcbeda44d0fa5e7d644f9ba3 | |
parent | 4d7887a2fab512f817b8c6b579314f1616c81d41 [diff] |
Fix race condition in NsdManagerTest NsdManagerTest relies on the lastMessage variable to assert the connection of a client to the service. The asserts in test are done on a different thread, although the variable was not qualified volatile, which creates the chance to read a stale value. This patch fixes this race by marking the variable volatile. Bug: 32561414 Bug: 62044295 Test: NsdManagerTest works Change-Id: I0bc2cd8059c6ff8b78a2dda0ba8d6bc7e13ef951