)]}'
{
  "commit": "c20bb681db3fd2d80cbca4477eaf0d3a502ed4c6",
  "tree": "a0b84b7871c47f54d686bfbba6cc7acf90f5f9a8",
  "parents": [
    "91a49831f3b05f6739c4af21aa6ff802cfe3ac71"
  ],
  "author": {
    "name": "Frank Li",
    "email": "Frank.Li@nxp.com",
    "time": "Fri Jan 11 11:56:47 2019 -0600"
  },
  "committer": {
    "name": "Nathan Hjelm",
    "email": "hjelmn@me.com",
    "time": "Wed Jan 30 22:38:32 2019 -0700"
  },
  "message": "fix race condition at event_handles\n\nevent_handles supposed just run at a thread.\n\nThere are re-entry check at begin.\n\n1: if (usbi_handling_events(ctx))\n2:\treturn LIBUSB_ERROR_BUSY;\n\n3: usbi_stat_event_handle(ctx);\n\nthis code is hold any lock\n\nit is possible two thread check 1 at the same time, then\ngo through to 3. So two threads will run event_handles.\n\nabove 3 line code should hold event_data_lock to avoid above\nrace condition.\n\n1: usbi_mutex_lock($ctx-\u003eevent_data_lock);\n2: r \u003d 0;\n3: if (usbi_handling_events(ctx))\n4: \tr \u003d LIBUSB_ERROR_BUSY;\n5: else\n6: \tusbi_start_event_handling(ctx);\n7: usbi_mutex_unlock($ctx-\u003eevent_data_lock);\n\n8: if(r)\n9:\treturn r;\n\ncheck and set in an atomic operations.\n\nCloses #520\n\nSigned-off-by: Frank Li \u003cFrank.Li@nxp.com\u003e\nSigned-off-by: Nathan Hjelm \u003chjelmn@me.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "8c2b02a2b13ac9afa8c9ac887852c05b6b62f342",
      "old_mode": 33188,
      "old_path": "libusb/io.c",
      "new_id": "6051d7f48a1fda31a45ef918229dcc9fb7f20b5f",
      "new_mode": 33188,
      "new_path": "libusb/io.c"
    },
    {
      "type": "modify",
      "old_id": "6d522b6a8ee8574560032ffb15a05c6fc5b459a9",
      "old_mode": 33188,
      "old_path": "libusb/version_nano.h",
      "new_id": "da4558fe68997be9506561553e67a43352bef152",
      "new_mode": 33188,
      "new_path": "libusb/version_nano.h"
    }
  ]
}
