]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: threads: replace the last few 1UL<<tid with tid_bit
authorWilly Tarreau <w@1wt.eu>
Tue, 31 Oct 2017 14:59:32 +0000 (15:59 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 31 Oct 2017 14:59:32 +0000 (15:59 +0100)
There were a few occurences left, better replace them now.

src/applet.c
src/flt_spoe.c
src/hlua.c
src/task.c

index b0783e6a639b2f3419eaa3224d99d62ffaa80a47..427062e36bcc08b51c5e1492e62f73799cd851fd 100644 (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);
index 938faabd25f7ede63fecbf5cd453c5a26787ebde..cdb6238f82ef8e40d2dcc4d741d2efbc2e3c1420 100644 (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;
index 6edb08a83b0195411eab3033d7c38796d9c72b2f..4911204a53dfef30bd1a32be660f990e2b3dbd9d 100644 (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;
index 0022bff302912c76e5a74f42cfc910bd5f329e51..7623da959640e07d2b41158874b2b63624db7675 100644 (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;