From d8459b3d3c8f9b1bfb3b6871b9c7d6e235cca6fa Mon Sep 17 00:00:00 2001 From: Yabin Cui Date: Wed, 26 Aug 2015 11:44:16 -0700 Subject: [PATCH] adb: fix a fake data race on transport:kick reported by tsan. It is reported by tsan as a double checked locking. But I think it is not a real data race. Because I think the old code is able to make sure t->kick() is only called once, and the caller of kick_transport is not relying on the side-effect of calling t->kick(). But as it is not perf critical, I don't mind breaking the double checked locking pattern. Bug: 23385662 Change-Id: Ie3597dd56bb514117c3865d2afcfd7c115731a78 --- adb/transport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adb/transport.cpp b/adb/transport.cpp index afdab86fa..03fe3044c 100644 --- a/adb/transport.cpp +++ b/adb/transport.cpp @@ -43,7 +43,7 @@ ADB_MUTEX_DEFINE( transport_lock ); void kick_transport(atransport* t) { - if (t && !t->kicked) + if (t != nullptr) { int kicked;