)]}'
{
  "commit": "3275fe8de161f30905e4aa58210ecaf0f749058d",
  "tree": "2d9091bf65fe6d61cddb41e9ad260a599d702f10",
  "parents": [
    "bc46ce75c89e0a3b8bb7d702cd66b1e67a40117f"
  ],
  "author": {
    "name": "Kirill Makurin",
    "email": "maiddaisuki@outlook.com",
    "time": "Fri Sep 11 17:22:23 2026 +0900"
  },
  "committer": {
    "name": "LIU Hao",
    "email": "lh_mouse@126.com",
    "time": "Fri Sep 11 23:07:41 2026 +0800"
  },
  "message": "winpthreads: mutex.c: move initialization logic to `pthread_mutex_init`\n\nMove initialization logic to `pthread_mutex_init`, where it belongs,\nand remove static function `mutex_impl_init`.\n\nUpdate `mutex_impl` function to call `pthread_mutex_init` instead of removed\n`mutex_impl_init`.\n\nBefore this change, initialization of `pthread_mutex_t` objects was handled\nas follows:\n\n1. Function `pthread_mutex_init` did not perform actual initialization,\n  but simply stored a static initializer in the `pthread_mutex_t` object.\n\n2. Later, when such statically initialized mutex was about to be used,\n  `mutex_impl` would call `mutex_impl_init` to allocate `mutex_impl_t`\n  structure and store its address in `pthread_mutex_t` object.\n\n3. In `pthread_mutex_lock_intern`, which is the implementation for public\n  `pthread_mutex_*lock` functions, it would create event object and store\n  it in `mutex_impl_t` structure.\n\nThis means that even after successful call to `pthread_mutex_init`,\ninitialized mutex still may be unusable:\n\n- Step 2 may fail to allocate `mutex_impl_t` structure due to out-of-memory\n  conditions.\n- Step 3 may fail to create event object.\n- In step 3, multiple threads may create an event object at the same time,\n  potentially exhausting resources available to the process.\n\nAfter this change, function `pthread_mutex_init` creates fully initialized\nmutex which does not require additional initialization steps later.\n\nSigned-off-by: Kirill Makurin \u003cmaiddaisuki@outlook.com\u003e\nSigned-off-by: LIU Hao \u003clh_mouse@126.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "d27c1e2e3e92aeb1be6a265fecc6961f6d93e365",
      "old_mode": 33188,
      "old_path": "mingw-w64-libraries/winpthreads/src/mutex.c",
      "new_id": "5859b6305bc958e310d1c22d6a241365d7c4597b",
      "new_mode": 33188,
      "new_path": "mingw-w64-libraries/winpthreads/src/mutex.c"
    }
  ]
}
