mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-23 14:51:27 +02:00
CLEANUP: fd: remove FD_POLL_DATA and FD_POLL_STICKY
The former was not used and the second was used only as a positive mask of the flags to keep instead of having the flags that are updated. Both were removed in favor of a new FD_POLL_UPDT_MASK that only mentions the updated flags. This will ease merging of state and ev later.
This commit is contained in:
parent
26754901e9
commit
fc0cdfb9b7
@ -42,8 +42,7 @@ enum {
|
|||||||
#define FD_POLL_ERR 0x08
|
#define FD_POLL_ERR 0x08
|
||||||
#define FD_POLL_HUP 0x10
|
#define FD_POLL_HUP 0x10
|
||||||
|
|
||||||
#define FD_POLL_DATA (FD_POLL_IN | FD_POLL_OUT)
|
#define FD_POLL_UPDT_MASK (FD_POLL_IN | FD_POLL_PRI | FD_POLL_OUT)
|
||||||
#define FD_POLL_STICKY (FD_POLL_ERR | FD_POLL_HUP)
|
|
||||||
|
|
||||||
/* FD_EV_* are the values used in fdtab[].state to define the polling states in
|
/* FD_EV_* are the values used in fdtab[].state to define the polling states in
|
||||||
* each direction. Most of them are manipulated using test-and-set operations
|
* each direction. Most of them are manipulated using test-and-set operations
|
||||||
|
@ -386,12 +386,12 @@ static inline void fd_update_events(int fd, unsigned char evts)
|
|||||||
}
|
}
|
||||||
|
|
||||||
old = fdtab[fd].ev;
|
old = fdtab[fd].ev;
|
||||||
new = (old & FD_POLL_STICKY) | new_flags;
|
new = (old & ~FD_POLL_UPDT_MASK) | new_flags;
|
||||||
|
|
||||||
if (unlikely(locked)) {
|
if (unlikely(locked)) {
|
||||||
/* Locked FDs (those with more than 2 threads) are atomically updated */
|
/* Locked FDs (those with more than 2 threads) are atomically updated */
|
||||||
while (unlikely(new != old && !_HA_ATOMIC_CAS(&fdtab[fd].ev, &old, new)))
|
while (unlikely(new != old && !_HA_ATOMIC_CAS(&fdtab[fd].ev, &old, new)))
|
||||||
new = (old & FD_POLL_STICKY) | new_flags;
|
new = (old & ~FD_POLL_UPDT_MASK) | new_flags;
|
||||||
} else {
|
} else {
|
||||||
if (new != old)
|
if (new != old)
|
||||||
fdtab[fd].ev = new;
|
fdtab[fd].ev = new;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user