extern struct global global;
extern int pid; /* current process id */
extern int relative_pid; /* process id starting at 1 */
-extern unsigned long pid_bit; /* bit corresponding to the process id */
-extern unsigned long all_proc_mask; /* mask of all processes */
extern int actconn; /* # of active sessions */
extern int listeners;
extern int jobs; /* # of active jobs (listeners, sessions, open devices) */
return 0;
}
-/* returns a mask if set, otherwise all_proc_mask */
+/* returns a mask if set, otherwise 1 */
static inline unsigned long proc_mask(unsigned long mask)
{
- return mask ? mask : all_proc_mask;
+ return mask ? mask : 1;
}
/* handle 'tainted' status */
*/
nbproc = my_popcountl(curproxy->bind_proc);
- curproxy->bind_proc &= all_proc_mask;
+ curproxy->bind_proc &= 1;
if (!curproxy->bind_proc && nbproc == 1) {
ha_warning("Proxy '%s': the process specified on the 'bind-process' directive refers to a process number that is higher than global.nbproc. The proxy has been forced to run on process 1 only.\n", curproxy->id);
curproxy->bind_proc = 1;
/* detect process and nbproc affinity inconsistencies */
mask = proc_mask(bind_conf->settings.bind_proc) & proc_mask(curproxy->bind_proc);
- if (!(mask & all_proc_mask)) {
- mask = proc_mask(curproxy->bind_proc) & all_proc_mask;
+ if (!(mask & 1)) {
+ mask = proc_mask(curproxy->bind_proc) & 1;
nbproc = my_popcountl(bind_conf->settings.bind_proc);
bind_conf->settings.bind_proc = proc_mask(bind_conf->settings.bind_proc) & mask;
int nbproc;
nbproc = my_popcountl(curproxy->bind_proc &
- (listener->bind_conf->settings.bind_proc ? listener->bind_conf->settings.bind_proc : curproxy->bind_proc) &
- all_proc_mask);
+ (listener->bind_conf->settings.bind_proc ? listener->bind_conf->settings.bind_proc : curproxy->bind_proc) & 1);
if (!nbproc) /* no intersection between listener and frontend */
nbproc = 1;
bind_conf->xprt->destroy_bind_conf(bind_conf);
}
- if (atleast2(curproxy->bind_proc & all_proc_mask)) {
+ if (atleast2(curproxy->bind_proc & 1)) {
if (curproxy->uri_auth) {
int count, maxproc = 0;
static struct list cfg_cfgfiles = LIST_HEAD_INIT(cfg_cfgfiles);
int pid; /* current process id */
int relative_pid = 1; /* process id starting at 1 */
-unsigned long pid_bit = 1; /* bit corresponding to the process id */
-unsigned long all_proc_mask = 1; /* mask of all processes */
volatile unsigned long sleeping_thread_mask = 0; /* Threads that are about to sleep in poll() */
volatile unsigned long stopping_thread_mask = 0; /* Threads acknowledged stopping */
global.nbthread = 1;
relative_pid = 1;
- pid_bit = 1;
- all_proc_mask = 1;
#ifdef USE_THREAD
tid_bit = 1;
BUG_ON(listener->rx.fd == -1);
if ((global.mode & (MODE_DAEMON | MODE_MWORKER)) &&
(!!master != !!(listener->rx.flags & RX_F_MWORKER) ||
- !(proc_mask(listener->rx.settings->bind_proc) & pid_bit))) {
+ !(proc_mask(listener->rx.settings->bind_proc) & 1))) {
/* we don't want to enable this listener and don't
* want any fd event to reach it.
*/
HA_SPIN_LOCK(LISTENER_LOCK, &l->lock);
if ((global.mode & (MODE_DAEMON | MODE_MWORKER)) &&
- !(proc_mask(l->rx.settings->bind_proc) & pid_bit))
+ !(proc_mask(l->rx.settings->bind_proc) & 1))
goto end;
if (l->state <= LI_PAUSED)
goto end;
if ((global.mode & (MODE_DAEMON | MODE_MWORKER)) &&
- !(proc_mask(l->rx.settings->bind_proc) & pid_bit))
+ !(proc_mask(l->rx.settings->bind_proc) & 1))
goto end;
if (l->state == LI_READY)
p->disabled = 1;
- if (!(proc_mask(p->bind_proc) & pid_bit))
+ if (!(proc_mask(p->bind_proc) & 1))
goto silent;
/* Note: syslog proxies use their own loggers so while it's somewhat OK
char *srvrecord;
/* we don't want to report any state if the backend is not enabled on this process */
- if (!(proc_mask(px->bind_proc) & pid_bit))
+ if (!(proc_mask(px->bind_proc) & 1))
return 1;
if (!appctx->ctx.cli.p1)
continue;
/* we don't want to list a backend which is bound to this process */
- if (!(proc_mask(curproxy->bind_proc) & pid_bit))
+ if (!(proc_mask(curproxy->bind_proc) & 1))
continue;
chunk_appendf(&trash, "%s\n", curproxy->id);