From d00406a5089c9e049e86e4c49ce8467fec92a93c Mon Sep 17 00:00:00 2001 From: Jafar Al-Gharaibeh Date: Thu, 2 Jan 2025 12:38:04 -0600 Subject: [PATCH] runtime: fix typo, drop unnecessary line and fix associated comment Signed-off-by: Jafar Al-Gharaibeh --- src/h/rmacros.h | 16 +++++----------- src/runtime/rcoexpr.r | 6 ++---- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/src/h/rmacros.h b/src/h/rmacros.h index e8d384cc2..6ae212645 100644 --- a/src/h/rmacros.h +++ b/src/h/rmacros.h @@ -106,14 +106,8 @@ #define Ts_Main 01 /* This is the main co-expression */ #define Ts_Thread 02 /* This is a thread */ #define Ts_Attached 04 /* OS-level thread attached to this ce */ - #define Ts_Async 010 /* asynchronous (concurrent) thread */ -#define Ts_Actived 020 /* activated at least once */ -#define Ts_Active 040 /* someone activated me */ - -#define Ts_WTinbox 0100 /* waiting on inbox Q */ -#define Ts_WToutbox 0200 /* waiting on outbox Q */ -#define Ts_Posix 0400 /* POSIX (pthread-based) coexpression */ +#define Ts_Posix 020 /* POSIX (pthread-based) coexpression */ #define Ts_SoftThread 01000 /* soft thread */ @@ -122,11 +116,11 @@ #define CHECK_FLAG(X,F) ((X) & (F)) #define NOT_CHECK_FLAG(X,F) (!CHECK_FLAG(X,F)) -#define IS_TS_MAIN(X) CHECK_FLAG(X, Ts_Main) -#define IS_TS_THREAD(X) CHECK_FLAG(X, Ts_Thread) +#define IS_TS_MAIN(X) CHECK_FLAG(X, Ts_Main) +#define IS_TS_THREAD(X) CHECK_FLAG(X, Ts_Thread) #define IS_TS_ATTACHED(X) CHECK_FLAG(X, Ts_Attached) -#define IS_TS_POSIX(X) CHECK_FLAG(X, Ts_Posix) -#define IS_TS_ASYNC(X) CHECK_FLAG(X, Ts_Async) +#define IS_TS_POSIX(X) CHECK_FLAG(X, Ts_Posix) +#define IS_TS_ASYNC(X) CHECK_FLAG(X, Ts_Async) #define IS_TS_SYNC(X) (!IS_TS_ASYNC(X)) #define IS_TS_SOFTTHREAD(X) CHECK_FLAG(X, Ts_SoftThread) diff --git a/src/runtime/rcoexpr.r b/src/runtime/rcoexpr.r index 1eda0c39b..081f8fe89 100644 --- a/src/runtime/rcoexpr.r +++ b/src/runtime/rcoexpr.r @@ -392,7 +392,7 @@ int co_chng(struct b_coexpr *ncp, * Each co-expression has its own posix thread. So always switch * to the new thread state when changing co-expressions. */ -#ifdef NativeCoSwitch +#ifdef NativeCoswitch if (ccp->program != ncp->program) { curtstate = ncp->tstate; global_curtstate = ncp->tstate; @@ -444,15 +444,13 @@ int co_chng(struct b_coexpr *ncp, /* * Time to switch context to the new co-expression. * the type of switch depends on whether the new co-expression - * has its own attached thread or not or if it is of type - * posix and being activated for the first time + * has its own attached thread or not. */ MUTEX_LOCKBLK(ncp, "lock co-expression"); #ifdef PthreadCoswitch if (IS_TS_ATTACHED(ncp->status)) { - SET_FLAG(ncp->status, Ts_Attached); MUTEX_UNLOCKBLK(ncp, "lock co-expression"); pthreadcoswitch(ccp, ncp, ccp->status, ncp->status ); }