Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d8459b3d authored by Yabin Cui's avatar Yabin Cui
Browse files

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
parent 53f11b62
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -43,7 +43,7 @@ ADB_MUTEX_DEFINE( transport_lock );


void kick_transport(atransport* t)
void kick_transport(atransport* t)
{
{
    if (t && !t->kicked)
    if (t != nullptr)
    {
    {
        int  kicked;
        int  kicked;