)]}'
{
  "commit": "d8973a71a3d1dd670e5dcdf6e94ec0cd45444eec",
  "tree": "5499bb2d33aa98100c1fdb4cef50a715f3d95f66",
  "parents": [
    "559bf2836f5da25b75bfb229fec0d20d540ee426"
  ],
  "author": {
    "name": "Keun young Park",
    "email": "keunyoung@google.com",
    "time": "Wed Mar 28 14:13:09 2012 -0700"
  },
  "committer": {
    "name": "Keun young Park",
    "email": "keunyoung@google.com",
    "time": "Wed Mar 28 14:13:09 2012 -0700"
  },
  "message": "Fix deadlock in camera destruction after client app\u0027s crash\n\n* why deadlock happened: when an app (CTS camera test) crashes while using\n  camera, its binder is closed and reference counter is decreased. If camera\n  is inside callback, sp\u003cClient\u003e inside callback will hold the Client instance,\n  and Client instance is destroyed when the callback ends as sp\u003cClient\u003e to hold\n  it no longer exists. The destructor of Client instance tries to clean up\n  camera H/W which tries to stop threads created by camera HAL including the\n  thread context where the callback is running. This causes deadlock where the\n  callback thread itself is waiting for itself to terminate.\n  Note that the deadlock will not happen if camera callback is not active. In\n  that case, closing of binder will force the destruction of Client instance,\n  and the destruction happens in binder thread.\n\n* Fix: Forces Client descruction in binder thread\n- remove sp\u003cClient\u003e from callbacks to prevent destruction in callback context\n- add client lock to allow callback to use raw pointer safely. This prevents\n  the destructor from deleting the instance while callback is using it.\n- add status change inside destructor with client lock to safely destroy Client\n\nBug: 6214383\nChange-Id: Ic6d6396d4d95ce9e72a16ec2480ae65c100fe806\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "22836e313fad3dbc5338b9cd170b506cbd0e76ee",
      "old_mode": 33188,
      "old_path": "services/camera/libcameraservice/CameraService.cpp",
      "new_id": "dc3f0830d91a0b27eec04dfcaf3a94b8f6422c68",
      "new_mode": 33188,
      "new_path": "services/camera/libcameraservice/CameraService.cpp"
    },
    {
      "type": "modify",
      "old_id": "457c79b2aa456bbf4b54488c49341d6caae6d63b",
      "old_mode": 33188,
      "old_path": "services/camera/libcameraservice/CameraService.h",
      "new_id": "79722011198a294fb0bd6b81b532fc3dd829f53d",
      "new_mode": 33188,
      "new_path": "services/camera/libcameraservice/CameraService.h"
    }
  ]
}
