]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: fd: remove the now unused fd_set_running()
authorWilly Tarreau <w@1wt.eu>
Tue, 3 Aug 2021 07:15:32 +0000 (09:15 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 4 Aug 2021 14:03:36 +0000 (16:03 +0200)
It was inlined inside fd_update_events() since it relies on a loop that
may return immediate failure codes.

include/haproxy/fd.h

index 8e1a442a32c823bec305b0f967abbf884483f652..5e9a96739e3ec15e36fcaa304ef72bf99af2cfc2 100644 (file)
@@ -311,37 +311,6 @@ static inline void fd_want_send(int fd)
        updt_fd_polling(fd);
 }
 
-/* Set the fd as currently running on the current thread.
- * Returns 0 if all goes well, or -1 if we no longer own the fd, and should
- * do nothing with it.
- */
-static inline int fd_set_running(int fd)
-{
-#ifndef HA_HAVE_CAS_DW
-       HA_RWLOCK_RDLOCK(OTHER_LOCK, &fd_mig_lock);
-       if (!(fdtab[fd].thread_mask & tid_bit)) {
-               HA_RWLOCK_RDUNLOCK(OTHER_LOCK, &fd_mig_lock);
-               return -1;
-       }
-       _HA_ATOMIC_OR(&fdtab[fd].running_mask, tid_bit);
-       HA_RWLOCK_RDUNLOCK(OTHER_LOCK, &fd_mig_lock);
-       return 0;
-#else
-       unsigned long old_masks[2];
-       unsigned long new_masks[2];
-       old_masks[0] = fdtab[fd].running_mask;
-       old_masks[1] = fdtab[fd].thread_mask;
-       do {
-               if (!(old_masks[1] & tid_bit))
-                       return -1;
-               new_masks[0] = fdtab[fd].running_mask | tid_bit;
-               new_masks[1] = old_masks[1];
-
-       } while (!(HA_ATOMIC_DWCAS(&fdtab[fd].running_mask, &old_masks, &new_masks)));
-       return 0;
-#endif
-}
-
 /* remove tid_bit from the fd's running mask and returns the bits that remain
  * after the atomic operation.
  */