{"author":"Jay Satiro","author_email":"raysatiro@yahoo.com","author_time":1737267503,"commit_time":1737441921,"committer":"Jay Satiro","committer_email":"raysatiro@yahoo.com","hash":"789c7f1b6c02e9af7919dfcdb0c59499e630dda9","message":"easy_lock: use Sleep(1) for thread yield on old Windows\n\n- Prefer Sleep(1) over sched_yield() for pre-Vista thread yield.\n\nOn Windows sched_yield is often implemented as Sleep(0) which only\nyields to threads of highest priority to current priority. However,\nduring libcurl initialization if there is thread contention then it's\npossible that there is a wait for a different library or OS thread of\na lesser priority and then the yield is not effective during that time.\nOn the other hand Sleep(1) will wait the minimum time slice which is\nusually like 15ms or more.\n\nPrior to this change 2c4bfef removed sched_yield detection on Windows,\nwhich effectively removed the yield in the spin lock, and therefore this\nchange restores the yield but in a different way.\n\nFor Windows Vista and later we use SRW locks and do not have this issue.\n\nRef: https://github.com/curl/curl/pull/16037#issuecomment-2600161764\nRef: https://devblogs.microsoft.com/oldnewthing/20051004-09/?p=33923\n\nCloses https://github.com/curl/curl/pull/16048\n","parents":["7c039292ad955db327dce4e9e6a3f612ddef3c58"],"tree_hash":"8565121f9d7ad2d2dedaa9077560cb64eaf594e4"}