Putting a thread to sleep using schedule() is foolproof?

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

 



Yes, there are other ways, but I have a doubt on one of the basic method of sleeping -

set_current_state (TASK_INTERRUPTIBLE);
schedule ();

Is this a sure-shot way of putting a thread to sleep, or are there conditions when this may not put the calling thread into sleep?

Almost always I see that the thread goes to sleep, until explicitly woken up by another thread. But, once it a blue moon, I find that thread executes the above instructions and does not go to sleep!

--
Joshi
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[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