CLEANUP: threads: replace the last few 1UL<<tid with tid_bit

There were a few occurences left, better replace them now.
This commit is contained in:
Willy Tarreau 2017-10-31 15:59:32 +01:00
parent 79a481ddde
commit 5f4a47b701
4 changed files with 7 additions and 7 deletions

View File

@ -43,7 +43,7 @@ void applet_run_active()
curr = LIST_NEXT(&applet_active_queue, typeof(curr), runq);
while (&curr->runq != &applet_active_queue) {
next = LIST_NEXT(&curr->runq, typeof(next), runq);
if (curr->process_mask & (1UL << tid)) {
if (curr->process_mask & tid_bit) {
LIST_DEL(&curr->runq);
curr->state = APPLET_RUNNING;
LIST_ADDQ(&applet_cur_queue, &curr->runq);

View File

@ -1949,7 +1949,7 @@ spoe_create_appctx(struct spoe_config *conf)
memset(appctx->ctx.spoe.ptr, 0, pool2_spoe_appctx->size);
appctx->st0 = SPOE_APPCTX_ST_CONNECT;
if ((SPOE_APPCTX(appctx)->task = task_new(1UL << tid)) == NULL)
if ((SPOE_APPCTX(appctx)->task = task_new(tid_bit)) == NULL)
goto out_free_spoe_appctx;
SPOE_APPCTX(appctx)->owner = appctx;

View File

@ -2510,7 +2510,7 @@ __LJMP static int hlua_socket_new(lua_State *L)
lua_setmetatable(L, -2);
/* Create the applet context */
appctx = appctx_new(&update_applet, 1UL << tid);
appctx = appctx_new(&update_applet, tid_bit);
if (!appctx) {
hlua_pusherror(L, "socket: out of memory");
goto out_fail_conf;
@ -6165,7 +6165,7 @@ static int hlua_applet_tcp_init(struct appctx *ctx, struct proxy *px, struct str
ctx->ctx.hlua_apptcp.flags = 0;
/* Create task used by signal to wakeup applets. */
task = task_new(1UL << tid);
task = task_new(tid_bit);
if (!task) {
SEND_ERR(px, "Lua applet tcp '%s': out of memory.\n",
ctx->rule->arg.hlua_rule->fcn.name);
@ -6366,7 +6366,7 @@ static int hlua_applet_http_init(struct appctx *ctx, struct proxy *px, struct st
ctx->ctx.hlua_apphttp.flags |= APPLET_HTTP11;
/* Create task used by signal to wakeup applets. */
task = task_new(1UL << tid);
task = task_new(tid_bit);
if (!task) {
SEND_ERR(px, "Lua applet http '%s': out of memory.\n",
ctx->rule->arg.hlua_rule->fcn.name);
@ -6911,7 +6911,7 @@ static int hlua_cli_parse_fct(char **args, struct appctx *appctx, void *private)
* We use the same wakeup fonction than the Lua applet_tcp and
* applet_http. It is absolutely compatible.
*/
appctx->ctx.hlua_cli.task = task_new(1UL << tid);
appctx->ctx.hlua_cli.task = task_new(tid_bit);
if (!appctx->ctx.hlua_cli.task) {
SEND_ERR(NULL, "Lua cli '%s': out of memory.\n", fcn->name);
goto error;

View File

@ -229,7 +229,7 @@ void process_runnable_tasks()
while (local_tasks_count < 16) {
t = eb32_entry(rq_next, struct task, rq);
rq_next = eb32_next(rq_next);
if (t->process_mask & (1UL << tid)) {
if (t->process_mask & tid_bit) {
/* detach the task from the queue */
__task_unlink_rq(t);
t->state |= TASK_RUNNING;