am 804180b2
: Merge "adb: fix a data race in local_socket_event_func."
* commit '804180b2ccf2ef4dedad7d136c060ecbdda7aac5': adb: fix a data race in local_socket_event_func.
This commit is contained in:
commit
860169cbf8
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