patch-2.4.20 linux-2.4.20/include/linux/sched.h

Next file: linux-2.4.20/include/linux/serio.h
Previous file: linux-2.4.20/include/linux/rwsem.h
Back to the patch index
Back to the overall index

diff -urN linux-2.4.19/include/linux/sched.h linux-2.4.20/include/linux/sched.h
@@ -458,8 +458,7 @@
 #define MAX_COUNTER	(20*HZ/100)
 #define DEF_NICE	(0)
 
-asmlinkage long sys_sched_yield(void);
-#define yield()	sys_sched_yield()
+extern void yield(void);
 
 /*
  * The default (Linux) execution domain.
@@ -611,7 +610,7 @@
 #define wake_up_interruptible_nr(x, nr)	__wake_up((x),TASK_INTERRUPTIBLE, nr)
 #define wake_up_interruptible_all(x)	__wake_up((x),TASK_INTERRUPTIBLE, 0)
 #define wake_up_interruptible_sync(x)	__wake_up_sync((x),TASK_INTERRUPTIBLE, 1)
-#define wake_up_interruptible_sync_nr(x) __wake_up_sync((x),TASK_INTERRUPTIBLE,  nr)
+#define wake_up_interruptible_sync_nr(x, nr) __wake_up_sync((x),TASK_INTERRUPTIBLE,  nr)
 asmlinkage long sys_wait4(pid_t pid,unsigned int * stat_addr, int options, struct rusage * ru);
 
 extern int in_group_p(gid_t);
@@ -944,6 +943,17 @@
 	return res;
 }
 
-#endif /* __KERNEL__ */
+static inline int need_resched(void)
+{
+	return (unlikely(current->need_resched));
+}
 
+extern void __cond_resched(void);
+static inline void cond_resched(void)
+{
+	if (need_resched())
+		__cond_resched();
+}
+
+#endif /* __KERNEL__ */
 #endif

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)