)]}'
{
  "log": [
    {
      "commit": "11859d467c035081f8acafeaf0184b670cd41c48",
      "tree": "36afb3b9c9bbff69d83945e7ab08b7687908f74c",
      "parents": [
        "132768084e24119c337e56fd110b97a23e5593c2"
      ],
      "author": {
        "name": "Elliott Hughes",
        "email": "enh@google.com",
        "time": "Mon Feb 13 17:59:29 2017 -0800"
      },
      "committer": {
        "name": "Elliott Hughes",
        "email": "enh@google.com",
        "time": "Mon Feb 13 17:59:29 2017 -0800"
      },
      "message": "Be more strict about using invalid `pthread_t`s.\n\nAnother release, another attempt to remove the global thread list.\n\nBut this time, let\u0027s admit that it\u0027s not going away. We can switch to using\na read/write lock for the global thread list, and to aborting rather than\nquietly returning ESRCH if we\u0027re given an invalid pthread_t.\n\nThis change affects pthread_detach, pthread_getcpuclockid,\npthread_getschedparam/pthread_setschedparam, pthread_join, and pthread_kill:\ninstead of returning ESRCH when passed an invalid pthread_t, if you\u0027re\ntargeting O or above, they\u0027ll abort with the message \"attempt to use\ninvalid pthread_t\".\n\nNote that this doesn\u0027t change behavior as much as you might think: the old\nlookup only held the global thread list lock for the duration of the lookup,\nso there was still a race between that and the dereference in the caller,\ngiven that callers actually need the tid to pass to some syscall or other,\nand sometimes update fields in the pthread_internal_t struct too.\n\n(This patch replaces such users with calls to pthread_gettid_np, which\nat least makes the TOCTOU window smaller.)\n\nWe can\u0027t check thread-\u003etid against 0 to see whether a pthread_t is still\nvalid because a dead thread gets its thread struct unmapped along with its\nstack, so the dereference isn\u0027t safe.\n\nTaking the affected functions one by one:\n\n    * pthread_getcpuclockid and pthread_getschedparam/pthread_setschedparam\n      should be fine. Unsafe calls to those seem highly unlikely.\n\n    * Unsafe pthread_detach callers probably want to switch to\n      pthread_attr_setdetachstate instead, or using\n      pthread_detach(pthread_self()) from the new thread\u0027s start routine\n      rather than doing the detach in the parent.\n\n    * pthread_join calls should be safe anyway, because a joinable thread\n      won\u0027t actually exit and unmap until it\u0027s joined. If you\u0027re joining an\n      unjoinable thread, the fix is to stop marking it detached. If you\u0027re\n      joining an already-joined thread, you need to rethink your design.\n\n    * Unsafe pthread_kill calls aren\u0027t portably fixable. (And are obviously\n      inherently non-portable as-is.) The best alternative on Android is to\n      use pthread_gettid_np at some point that you know the thread to be\n      alive, and then call kill/tgkill directly.\n\n      That\u0027s still not completely safe because if you\u0027re too late, the tid\n      may have been reused, but then your code is inherently unsafe anyway.\n\nBug: http://b/19636317\nTest: ran tests\nChange-Id: I0372c4428e8a7f1c3af5c9334f5d9c25f2c73f21\n"
    },
    {
      "commit": "0f001b67fea27f8d60afc4677e8970d32a4e3792",
      "tree": "208844ca4857eea0aaad56bbd0018e47201add50",
      "parents": [
        "d74aa580354037b9972524e9d654c0a336974838"
      ],
      "author": {
        "name": "Elliott Hughes",
        "email": "enh@google.com",
        "time": "Fri Sep 12 11:35:05 2014 -0700"
      },
      "committer": {
        "name": "Elliott Hughes",
        "email": "enh@google.com",
        "time": "Fri Sep 12 11:35:05 2014 -0700"
      },
      "message": "Remove \"private/bionic_pthread.h\".\n\nBug: 17476168\nChange-Id: Id642987e641de81e914a28daea4ffe9d11e090ed\n"
    },
    {
      "commit": "a4831cb4a3f44b93788488db8ff9ea76613f0355",
      "tree": "eaa225c537d468307739bc48bbc86e241ada58e0",
      "parents": [
        "ea66004c4a051e40c49314d808e7359634f6c641"
      ],
      "author": {
        "name": "Elliott Hughes",
        "email": "enh@google.com",
        "time": "Thu Sep 11 16:11:43 2014 -0700"
      },
      "committer": {
        "name": "Elliott Hughes",
        "email": "enh@google.com",
        "time": "Thu Sep 11 16:22:50 2014 -0700"
      },
      "message": "Add pthread_gettid_np and re-expose __get_thread for LP32.\n\nA lot of third-party code calls the private __get_thread symbol,\noften as part of a backport of bionic\u0027s pthread_rwlock implementation.\nHopefully this will go away for LP64 (since you\u0027re guaranteed the\nreal implementation there), but there are still APIs that take a tid\nand no way to convert between a pthread_t and a tid. pthread_gettid_np\nis a public API for that. To aid the transition, make __get_thread\navailable again for LP32.\n\n(cherry-pick of 27efc48814b8153c55cbcd0af5d9add824816e69.)\n\nBug: 14079438\nChange-Id: I43fabc7f1918250d31d4665ffa4ca352d0dbeac1\n"
    }
  ]
}
