Merge "adb: fix a data race in local_socket_event_func."
This commit is contained in:
commit
804180b2cc
1 changed files with 5 additions and 2 deletions
|
@ -360,9 +360,12 @@ static void local_socket_event_func(int fd, unsigned ev, void* _s)
|
|||
} else {
|
||||
p->len = max_payload - avail;
|
||||
|
||||
// s->peer->enqueue() may call s->close() and free s,
|
||||
// so save variables for debug printing below.
|
||||
unsigned saved_id = s->id;
|
||||
int saved_fd = s->fd;
|
||||
r = s->peer->enqueue(s->peer, p);
|
||||
D("LS(%d): fd=%d post peer->enqueue(). r=%d\n", s->id, s->fd,
|
||||
r);
|
||||
D("LS(%u): fd=%d post peer->enqueue(). r=%d\n", saved_id, saved_fd, r);
|
||||
|
||||
if (r < 0) {
|
||||
/* error return means they closed us as a side-effect
|
||||
|
|
Loading…
Reference in a new issue