All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm-3NddpPZAyC0@public.gmane.org>
To: Matthew Wilcox <willy-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org>
Cc: umka-nJ1KrdHEGnBBDgjK7y7TUQ@public.gmane.org,
	acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: down_timeout
Date: Fri, 3 Oct 2003 13:36:32 -0700	[thread overview]
Message-ID: <20031003133632.4b8cd1bc.akpm@osdl.org> (raw)
In-Reply-To: <20031003142518.GN24824-+pPCBgu9SkPzIGdyhVEDUDl5KyyQGfY2kSSpQ9I8OhVaa/9Udqfwiw@public.gmane.org>

Matthew Wilcox <willy-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org> wrote:
>
> /* Returns -EINTR if the timeout expires */
> int down_timeout(struct semaphore *sem, long timeout)
> {
> 	struct timer_list timer;
> 	int result;
> 
> 	init_timer(&timer);
> 	timer.expires = timeout + jiffies;
> 	timer.data = (unsigned long) current;
> 	timer.function = process_timeout;
> 
> 	add_timer(&timer);
> 	result = down_interruptible(sem);
> 	del_timer_sync(&timer);
> 
> 	return result;
> }

down_interruptible() will only break out if signal_pending(current), so the
wakeup-on-expiry here will not work as desired.

New per-arch primitives would be needed to implement this, I think.



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

WARNING: multiple messages have this Message-ID (diff)
From: Andrew Morton <akpm@osdl.org>
To: Matthew Wilcox <willy@debian.org>
Cc: umka@namesys.com, acpi-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: Re: down_timeout
Date: Fri, 3 Oct 2003 13:36:32 -0700	[thread overview]
Message-ID: <20031003133632.4b8cd1bc.akpm@osdl.org> (raw)
In-Reply-To: <20031003142518.GN24824@parcelfarce.linux.theplanet.co.uk>

Matthew Wilcox <willy@debian.org> wrote:
>
> /* Returns -EINTR if the timeout expires */
> int down_timeout(struct semaphore *sem, long timeout)
> {
> 	struct timer_list timer;
> 	int result;
> 
> 	init_timer(&timer);
> 	timer.expires = timeout + jiffies;
> 	timer.data = (unsigned long) current;
> 	timer.function = process_timeout;
> 
> 	add_timer(&timer);
> 	result = down_interruptible(sem);
> 	del_timer_sync(&timer);
> 
> 	return result;
> }

down_interruptible() will only break out if signal_pending(current), so the
wakeup-on-expiry here will not work as desired.

New per-arch primitives would be needed to implement this, I think.


  parent reply	other threads:[~2003-10-03 20:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-03 12:37 os_wait_semaphore() Yury Umanets
     [not found] ` <3F7D6DA1.9070801-nJ1KrdHEGnBBDgjK7y7TUQ@public.gmane.org>
2003-10-03 14:25   ` down_timeout Matthew Wilcox
2003-10-03 14:25     ` down_timeout Matthew Wilcox
     [not found]     ` <20031003142518.GN24824-+pPCBgu9SkPzIGdyhVEDUDl5KyyQGfY2kSSpQ9I8OhVaa/9Udqfwiw@public.gmane.org>
2003-10-03 20:36       ` Andrew Morton [this message]
2003-10-03 20:36         ` down_timeout Andrew Morton
  -- strict thread matches above, loose matches on Subject: below --
2003-10-03 20:29 down_timeout Moore, Robert
     [not found] ` <D3A3AA459175A44CB5326F26DA7A189C1C3DD3-sBd4vmA9Se58QrAoInS571DQ4js95KgL@public.gmane.org>
2003-10-03 23:29   ` down_timeout Alan Cox
2003-10-03 18:03 down_timeout Grover, Andrew
2003-10-03 18:03 ` down_timeout Grover, Andrew
2003-10-04  7:53 ` down_timeout Ingo Oeser
2001-04-26 16:27 down_timeout Moore, Robert
2001-04-25 23:21 down_timeout Grover, Andrew
2001-04-25 23:49 ` down_timeout Ingo Oeser

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=20031003133632.4b8cd1bc.akpm@osdl.org \
    --to=akpm-3nddppzayc0@public.gmane.org \
    --cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=umka-nJ1KrdHEGnBBDgjK7y7TUQ@public.gmane.org \
    --cc=willy-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org \
    /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.