Skip to content

Conversation

@bjackson312006
Copy link
Contributor

Added mutex_isOwned(mutex_t* mutex), which checks if the passed-in mutex is owned by the current thread. Returns true if so, and false if not.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new function mutex_isOwned() to check if a mutex is owned by the current thread, returning a boolean result. The implementation uses ThreadX API functions tx_mutex_info_get() and tx_thread_identify() to compare the mutex owner with the calling thread.

Key Changes

  • Added mutex_isOwned() function implementation that queries mutex ownership and compares it with the current thread
  • Declared the new function in the mutex header file with appropriate comment documentation

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
threadX/src/u_tx_mutex.c Implements the mutex_isOwned() function with error handling and thread comparison logic
threadX/inc/u_tx_mutex.h Adds the function declaration to the public API

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants