)]}'
{
  "commit": "cfc8745aee93707ccbe5c41c908eae52aebacec7",
  "tree": "37403017a3d82398a05112102a7dbba7fdbfbb71",
  "parents": [
    "f395fdb59ab9d5ee980da875343aa50e04d46235"
  ],
  "author": {
    "name": "Cameron Gutman",
    "email": "aicommander@gmail.com",
    "time": "Mon Feb 08 18:31:08 2021 -0600"
  },
  "committer": {
    "name": "Cameron Gutman",
    "email": "aicommander@gmail.com",
    "time": "Mon Feb 08 18:31:08 2021 -0600"
  },
  "message": "Fix waiting on condition variables with the SRW lock implmentation\n\nWhen SleepConditionVariableSRW() releases the SRW lock internally, it causes\nour SDL_mutex_srw state to become inconsistent. The lock is unowned yet inside,\nthe owner is still the sleeping thread and more importantly the owner count is\nstill 1.\n\nThe next time someone acquires the lock, they will bump the owner count from 1\nto 2. At that point, the lock is hosed. From the internal lock state, it looks\nto us like that owner has acquired the lock recursively, even though they have\nnot. When they call SDL_UnlockMutex(), it will see the owner count \u003e 0 and not\ncall ReleaseSRWLockExclusive().\n\nNow when someone calls SDL_CondSignal(), SleepConditionVariableSRW() will start\nthe wakeup process by attempting to re-acquire the SRW lock. This will deadlock\nbecause the lock was never released after the other thread had used it. The\nthread waiting on the condition variable will never be able to wake up, even if\nthe SDL_CondWaitTimeout() function is used and the timeout expires.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "139baccbf49740cb097db836d2162270fc9530e7",
      "old_mode": 33188,
      "old_path": "src/thread/windows/SDL_syscond_srw.c",
      "new_id": "763a5465e0f47c5abb8b740172e0664c6c82e3c7",
      "new_mode": 33188,
      "new_path": "src/thread/windows/SDL_syscond_srw.c"
    },
    {
      "type": "modify",
      "old_id": "bac5ea5471d075ee47747bfcf196c95d1697e8a5",
      "old_mode": 33188,
      "old_path": "src/thread/windows/SDL_sysmutex.c",
      "new_id": "6bf9f83c2288c24c85c8f963f19185348c4eed6b",
      "new_mode": 33188,
      "new_path": "src/thread/windows/SDL_sysmutex.c"
    }
  ]
}
