File: delay.h

package info (click to toggle)
comedi 0.7.76%2B20080817cvs-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 7,660 kB
  • ctags: 14,259
  • sloc: ansic: 104,304; sh: 1,417; makefile: 625; perl: 457
file content (23 lines) | stat: -rw-r--r-- 498 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

#ifndef __COMPAT_LINUX_DELAY_H
#define __COMPAT_LINUX_DELAY_H

#include <linux/version.h>
#include <linux/time.h>

#include_next <linux/delay.h>

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9)
static inline unsigned long msleep_interruptible(unsigned int msecs)
{
	unsigned long timeout = msecs_to_jiffies(msecs);

	while (timeout && !signal_pending(current)) {
		set_current_state(TASK_INTERRUPTIBLE);
		timeout = schedule_timeout(timeout);
	}
	return jiffies_to_msecs(timeout);
}
#endif

#endif