lkml.org 
[lkml]   [2007]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Sleeping thread not receive signal until it wakes up

On Mar 7 2007 08:19, linux-os (Dick Johnson) wrote:
>
>Later versions of the kernel lock the kernel when an ioctl() is
>entered. This means that if you sleep in the ioctl(), nothing
>will get scheduled.

Later versions of the kernel also have an ->unlocked_ioctl method,
which is probably better than below's approach [which is akin to
FreeBSD's DROP_GIANT/PICKUP_GIANT].

>You can do the following (possibly unsafe) in your ioctl():
>
> int locked = kernel_locked();
>
> ......... code
> ......... code
>
> if(locked) // Before sleeping section
> unlock_kernel();
> .......... sleeping code
> if(locked) // After sleeping section
> lock_kernel();
>
>

Jan
--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-03-07 21:23    [W:0.276 / U:0.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site