commit | 1ff9104117c67c99130c3b141d8fc236b3aa22a7 | [log] [tgz] |
---|---|---|
author | Olivier Houchard <ohouchard@haproxy.com> | Thu Feb 08 16:03:33 2018 +0000 |
committer | Willy Tarreau <w@1wt.eu> | Thu Feb 08 17:24:06 2018 +0100 |
tree | c702d8aa8cefdf6548c51df5c40da5bed46d258b | |
parent | 58aa5ccd7675e5c960b045e96fdf69845d6449b4 [diff] |
BUG/MINOR: fd/threads: properly lock the FD before adding it to the fd cache. It was believed that it was useless to lock the "prev" field when adding a FD. However, if there's only one element in the FD cache, and that element removes itself from the fd cache, and another FD is added before the first add completed, there's a risk of losing elements. To prevent that, lock the "prev" field, so that such a removal will wait until the add completed.