Added boolean to encode termination requests; added start flag as system flag

This commit is contained in:
dario
2023-10-27 12:43:13 +02:00
parent 87ef535471
commit 067a48c309
2 changed files with 35 additions and 3 deletions

View File

@@ -14,7 +14,7 @@
/**
* @brief Number of bits in task notification flags used internally.
*/
#define STA_RTOS_MAX_BITS_THREAD_SYS_NOTIFY 1U
#define STA_RTOS_MAX_BITS_THREAD_SYS_NOTIFY 2U
/**
* @brief Number of user usable bits in task notification flags.
*/
@@ -91,10 +91,23 @@ namespace sta
*/
uint32_t getFlags();
/**
* @brief Wait for certain thread flags.
*
* @return Returns the flags triggering the activation.
*/
uint32_t wait(uint32_t flags);
/**
* @brief Send termination request to thread.
*/
void requestTermination();
/**
* @brief Returns true if this thread was requested to terminate.
*/
bool checkTerminationRequest();
/**
* @brief Forcibly terminate thread.
*/
@@ -109,6 +122,7 @@ namespace sta
private:
Handle handle_;
bool terminate_;
};
} // namespace sta