From 6bd28132ed73804f8bc2a411b65d9ac6dbdb0c96 Mon Sep 17 00:00:00 2001 From: adamdunkels Date: Tue, 26 Sep 2006 20:57:58 +0000 Subject: [PATCH] Fixed the behaviour of PT_SCHEDULE() so that it returns true if a protothread is still active (yielded or waiting). Thanks to Kevin Collins for fixing. --- core/sys/pt.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/sys/pt.h b/core/sys/pt.h index 23f861fb2..1c3efa275 100644 --- a/core/sys/pt.h +++ b/core/sys/pt.h @@ -30,7 +30,7 @@ * * Author: Adam Dunkels * - * $Id: pt.h,v 1.1 2006/06/17 22:41:20 adamdunkels Exp $ + * $Id: pt.h,v 1.2 2006/09/26 20:57:58 adamdunkels Exp $ */ /** @@ -56,9 +56,9 @@ struct pt { }; #define PT_WAITING 0 -#define PT_EXITED 1 -#define PT_ENDED 2 -#define PT_YIELDED 3 +#define PT_YIELDED 1 +#define PT_EXITED 2 +#define PT_ENDED 3 /** * \name Initialization @@ -268,7 +268,7 @@ struct pt { * * \hideinitializer */ -#define PT_SCHEDULE(f) ((f) == PT_WAITING) +#define PT_SCHEDULE(f) ((f) < PT_EXITED) /** @} */