Re: Hello driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/22/05, Tyler <tyler@xxxxxxxx> wrote:
> Thomas Petazzoni wrote:
> > Hello,
> >
> > Greg KH wrote:
> >
> >>>     down_interruptible(&sem) ;
> >>
> >>
> >> Why interruptible?
> >
> >
> > Another remark : if you really need to use down_interruptible() (for
> > some reason), be sure to check the return value of this function. As the
> > name says, when you call this function, you can be interrupted by a
> > signal. So, you should not assume that once down_interruptible() as
> > returned, you own the corresponding semaphore : you may have been
> > interrupted by a signal.
> >
> > Sincerly,
> >
> > Thomas
> Ok, but in fact I'v no reason to use the interruptible locking
> semaphores function.
> Thx anyway :)

I think its always better to use the down_interruptible() rather than
only down() function, as down_interruptible allows the user
interference using signals. May I know why you said "I'v no reason to
use the interruptible locking semaphores function."

-gd

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux