From 1df530a36b69348ac15ebae1737da2dea6b0471b Mon Sep 17 00:00:00 2001 From: kevin Date: Sat, 29 Mar 2025 12:29:49 -0400 Subject: [PATCH] cwThread.cpp : Added check for state=='exited' in wait for state. --- cwThread.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cwThread.cpp b/cwThread.cpp index b718b7a..47434d5 100644 --- a/cwThread.cpp +++ b/cwThread.cpp @@ -59,6 +59,11 @@ namespace cw if(curStateId == stateId ) break; + + if(curStateId == kExitedThId) + { + return cwLogError(kInvalidStateRC,"Cannot wait on an thread that has already exited."); + } sleepUs( p->waitMicros );