OSDN Git Service

Fix a possible SensorService deadlock.
authorAravind Akella <aakella@google.com>
Thu, 25 Sep 2014 05:12:58 +0000 (22:12 -0700)
committerAravind Akella <aakella@google.com>
Sun, 28 Sep 2014 21:26:49 +0000 (21:26 +0000)
commite148bc29c27ae7a346fa686fdda6425ba202d97a
tree1dbe3a37705e4de0e98c40ff1378663b04ed7c50
parent728a8da14638e718ede11a7a894705524fc9d171
Fix a possible SensorService deadlock.

 If the destructor of SensorEventConnection gets called when the main
 sendEvents loop of SensorService is executing it may result in a deadlock.
 The loop promotes each connection to a strong_pointer, calls sendEvents
 and cleans up the connection if necessary. It is possible that the sp's
 destructor may delete SensorEventConnection which will call the dtor
 ~SensorEventConnection(). This dtor again needs SensorService mLock to
 execute which may result in a deadlock.

Bug: 17617897
Change-Id: I76c244dbe85fadb591c0bd1a9a5eb01d93f56505
services/sensorservice/SensorService.cpp