Interrupt thread before closing socket

Test failed when socket.close() ran, and in the other thread
we are trying to initialize an InetSocketAddress. If the socket
was closed, the port got from the socket object becomes -1 hence
the InetSocketAddress cannot be constructed and the
IllegalArgumentException would be thrown.

Interrupt thread before closing socket to prevent from the race.

Test: atest TestDnsServerTest --rerun-until-failure 1000
Fix: 259160848
Change-Id: I219ee1e32144ba9983a28765e7a84621c27c1c09
1 file changed
tree: f83086f99c4d7026f0accb4d26f32171b44dc8ae
  1. staticlibs/