All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Korty <joe.korty@ccur.com>
To: roland@redhat.com
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: [PATCH] posix timers using == instead of & for bitmask tests
Date: Fri, 22 Oct 2004 10:39:53 -0400	[thread overview]
Message-ID: <20041022143953.GA17881@tsunami.ccur.com> (raw)

Make posix-timers do a get_task_struct / put_task_struct if either
SIGEV_SIGNAL or SIGEV_THREAD_ID is set.  Currently the get/put is done
only if both are set.

Compiles but is otherwise untested.

Joe

--- base/kernel/posix-timers.c	2004-10-18 17:54:22.000000000 -0400
+++ new/kernel/posix-timers.c	2004-10-22 10:25:51.000000000 -0400
@@ -548,7 +548,7 @@
 	}
 	sigqueue_free(tmr->sigq);
 	if (unlikely(tmr->it_process) &&
-	    tmr->it_sigev_notify == (SIGEV_SIGNAL|SIGEV_THREAD_ID))
+	    (tmr->it_sigev_notify & (SIGEV_SIGNAL | SIGEV_THREAD_ID)))
 		put_task_struct(tmr->it_process);
 	kmem_cache_free(posix_timers_cache, tmr);
 }
@@ -650,7 +650,7 @@
 				list_add(&new_timer->list,
 					 &process->signal->posix_timers);
 				spin_unlock_irqrestore(&process->sighand->siglock, flags);
-				if (new_timer->it_sigev_notify == (SIGEV_SIGNAL|SIGEV_THREAD_ID))
+				if (new_timer->it_sigev_notify & (SIGEV_SIGNAL | SIGEV_THREAD_ID))
 					get_task_struct(process);
 			} else {
 				spin_unlock_irqrestore(&process->sighand->siglock, flags);
@@ -1101,7 +1101,7 @@
 	 * they got something (see the lock code above).
 	 */
 	if (timer->it_process) {
-		if (timer->it_sigev_notify == (SIGEV_SIGNAL|SIGEV_THREAD_ID))
+		if (timer->it_sigev_notify & (SIGEV_SIGNAL | SIGEV_THREAD_ID))
 			put_task_struct(timer->it_process);
 		timer->it_process = NULL;
 	}
@@ -1138,7 +1138,7 @@
 	 * they got something (see the lock code above).
 	 */
 	if (timer->it_process) {
-		if (timer->it_sigev_notify == (SIGEV_SIGNAL|SIGEV_THREAD_ID))
+		if (timer->it_sigev_notify & (SIGEV_SIGNAL | SIGEV_THREAD_ID))
 			put_task_struct(timer->it_process);
 		timer->it_process = NULL;
 	}

             reply	other threads:[~2004-10-22 14:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-22 14:39 Joe Korty [this message]
2004-10-22 22:03 ` [PATCH] posix timers using == instead of & for bitmask tests Roland McGrath
2004-10-23  2:27   ` Joe Korty
2004-10-23  2:50     ` Roland McGrath

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041022143953.GA17881@tsunami.ccur.com \
    --to=joe.korty@ccur.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roland@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.