Fixed the incorrect loop bound constant in the IAR file lock support (#695)

The IAR multithreaded library support code allocates its file lock
mutexes from an array of _MAX_FLOCK entries, but the wrap-around check
and the exhaustion check in __iar_file_Mtxinit() both compared against
_MAX_LOCK, the bound of the unrelated system lock mutex array.

When _MAX_FLOCK is greater than _MAX_LOCK, the free mutex index wrapped
early and the exhaustion check reported failure while free entries
remained, so *m was set to TX_NULL and the application faulted the first
time a file lock was taken.  When _MAX_FLOCK is smaller than _MAX_LOCK,
the free mutex index was allowed to run past the end of
__tx_iar_file_lock_mutexes and the exhaustion check could never fire.

Corrected all four comparisons in each of the 27 copies of tx_iar.c.

Fixes #444

Assisted-by: Copilot (Opus 5) <noreply@github.com>
This commit is contained in:
Frédéric Desbiens
2026-09-03 13:50:31 -04:00
committed by GitHub
parent 17ff21a07f
commit 508af549da
27 changed files with 135 additions and 108 deletions
+5 -4
View File
@@ -9,6 +9,7 @@
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
**************************************************************************/ **************************************************************************/
// Some portions generated by Copilot (Opus 5).
/**************************************************************************/ /**************************************************************************/
/**************************************************************************/ /**************************************************************************/
@@ -270,7 +271,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -287,7 +288,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
@@ -678,7 +679,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -695,7 +696,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
+5 -4
View File
@@ -9,6 +9,7 @@
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
**************************************************************************/ **************************************************************************/
// Some portions generated by Copilot (Opus 5).
/**************************************************************************/ /**************************************************************************/
/**************************************************************************/ /**************************************************************************/
@@ -270,7 +271,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -287,7 +288,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
@@ -678,7 +679,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -695,7 +696,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
+5 -4
View File
@@ -9,6 +9,7 @@
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
**************************************************************************/ **************************************************************************/
// Some portions generated by Copilot (Opus 5).
/**************************************************************************/ /**************************************************************************/
/**************************************************************************/ /**************************************************************************/
@@ -270,7 +271,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -287,7 +288,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
@@ -678,7 +679,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -695,7 +696,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
+5 -4
View File
@@ -9,6 +9,7 @@
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
**************************************************************************/ **************************************************************************/
// Some portions generated by Copilot (Opus 5).
/**************************************************************************/ /**************************************************************************/
/**************************************************************************/ /**************************************************************************/
@@ -270,7 +271,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -287,7 +288,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
@@ -678,7 +679,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -695,7 +696,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
+5 -4
View File
@@ -9,6 +9,7 @@
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
**************************************************************************/ **************************************************************************/
// Some portions generated by Copilot (Opus 5).
/**************************************************************************/ /**************************************************************************/
/**************************************************************************/ /**************************************************************************/
@@ -270,7 +271,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -287,7 +288,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
@@ -678,7 +679,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -695,7 +696,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
+5 -4
View File
@@ -9,6 +9,7 @@
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
**************************************************************************/ **************************************************************************/
// Some portions generated by Copilot (Opus 5).
/**************************************************************************/ /**************************************************************************/
/**************************************************************************/ /**************************************************************************/
@@ -270,7 +271,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -287,7 +288,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
@@ -678,7 +679,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -695,7 +696,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
+5 -4
View File
@@ -9,6 +9,7 @@
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
**************************************************************************/ **************************************************************************/
// Some portions generated by Copilot (Opus 5).
/**************************************************************************/ /**************************************************************************/
/**************************************************************************/ /**************************************************************************/
@@ -270,7 +271,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -287,7 +288,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
@@ -678,7 +679,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -695,7 +696,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
+5 -4
View File
@@ -9,6 +9,7 @@
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
**************************************************************************/ **************************************************************************/
// Some portions generated by Copilot (Opus 5).
/**************************************************************************/ /**************************************************************************/
/**************************************************************************/ /**************************************************************************/
@@ -270,7 +271,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -287,7 +288,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
@@ -678,7 +679,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -695,7 +696,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
+5 -4
View File
@@ -9,6 +9,7 @@
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
**************************************************************************/ **************************************************************************/
// Some portions generated by Copilot (Opus 5).
/**************************************************************************/ /**************************************************************************/
/**************************************************************************/ /**************************************************************************/
@@ -270,7 +271,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -287,7 +288,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
@@ -678,7 +679,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -695,7 +696,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
+5 -4
View File
@@ -9,6 +9,7 @@
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
**************************************************************************/ **************************************************************************/
// Some portions generated by Copilot (Opus 5).
/**************************************************************************/ /**************************************************************************/
/**************************************************************************/ /**************************************************************************/
@@ -270,7 +271,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -287,7 +288,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
@@ -678,7 +679,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -695,7 +696,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
+5 -4
View File
@@ -9,6 +9,7 @@
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
**************************************************************************/ **************************************************************************/
// Some portions generated by Copilot (Opus 5).
/**************************************************************************/ /**************************************************************************/
/**************************************************************************/ /**************************************************************************/
@@ -270,7 +271,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -287,7 +288,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
@@ -678,7 +679,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -695,7 +696,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
+5 -4
View File
@@ -9,6 +9,7 @@
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
**************************************************************************/ **************************************************************************/
// Some portions generated by Copilot (Opus 5).
/**************************************************************************/ /**************************************************************************/
/**************************************************************************/ /**************************************************************************/
@@ -270,7 +271,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -287,7 +288,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
@@ -678,7 +679,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -695,7 +696,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
+5 -4
View File
@@ -9,6 +9,7 @@
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
**************************************************************************/ **************************************************************************/
// Some portions generated by Copilot (Opus 5).
/**************************************************************************/ /**************************************************************************/
/**************************************************************************/ /**************************************************************************/
@@ -270,7 +271,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -287,7 +288,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
@@ -678,7 +679,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -695,7 +696,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
+5 -4
View File
@@ -9,6 +9,7 @@
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
**************************************************************************/ **************************************************************************/
// Some portions generated by Copilot (Opus 5).
/**************************************************************************/ /**************************************************************************/
/**************************************************************************/ /**************************************************************************/
@@ -270,7 +271,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -287,7 +288,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
@@ -678,7 +679,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -695,7 +696,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
+5 -4
View File
@@ -9,6 +9,7 @@
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
**************************************************************************/ **************************************************************************/
// Some portions generated by Copilot (Opus 5).
/**************************************************************************/ /**************************************************************************/
/**************************************************************************/ /**************************************************************************/
@@ -270,7 +271,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -287,7 +288,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
@@ -678,7 +679,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -695,7 +696,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
+5 -4
View File
@@ -9,6 +9,7 @@
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
**************************************************************************/ **************************************************************************/
// Some portions generated by Copilot (Opus 5).
/**************************************************************************/ /**************************************************************************/
/**************************************************************************/ /**************************************************************************/
@@ -270,7 +271,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -287,7 +288,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
@@ -678,7 +679,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -695,7 +696,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
+5 -4
View File
@@ -9,6 +9,7 @@
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
**************************************************************************/ **************************************************************************/
// Some portions generated by Copilot (Opus 5).
/**************************************************************************/ /**************************************************************************/
/**************************************************************************/ /**************************************************************************/
@@ -270,7 +271,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -287,7 +288,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
@@ -678,7 +679,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -695,7 +696,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
+5 -4
View File
@@ -9,6 +9,7 @@
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
**************************************************************************/ **************************************************************************/
// Some portions generated by Copilot (Opus 5).
/**************************************************************************/ /**************************************************************************/
/**************************************************************************/ /**************************************************************************/
@@ -270,7 +271,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -287,7 +288,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
@@ -678,7 +679,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -695,7 +696,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
+5 -4
View File
@@ -9,6 +9,7 @@
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
**************************************************************************/ **************************************************************************/
// Some portions generated by Copilot (Opus 5).
/**************************************************************************/ /**************************************************************************/
/**************************************************************************/ /**************************************************************************/
@@ -270,7 +271,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -287,7 +288,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
@@ -678,7 +679,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -695,7 +696,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
@@ -9,6 +9,7 @@
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
**************************************************************************/ **************************************************************************/
// Some portions generated by Copilot (Opus 5).
/**************************************************************************/ /**************************************************************************/
/**************************************************************************/ /**************************************************************************/
@@ -270,7 +271,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -287,7 +288,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
@@ -678,7 +679,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -695,7 +696,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
+5 -4
View File
@@ -9,6 +9,7 @@
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
**************************************************************************/ **************************************************************************/
// Some portions generated by Copilot (Opus 5).
/**************************************************************************/ /**************************************************************************/
/**************************************************************************/ /**************************************************************************/
@@ -270,7 +271,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -287,7 +288,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
@@ -678,7 +679,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -695,7 +696,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
@@ -9,6 +9,7 @@
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
**************************************************************************/ **************************************************************************/
// Some portions generated by Copilot (Opus 5).
/**************************************************************************/ /**************************************************************************/
/**************************************************************************/ /**************************************************************************/
@@ -270,7 +271,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -287,7 +288,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
@@ -678,7 +679,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -695,7 +696,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
@@ -9,6 +9,7 @@
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
**************************************************************************/ **************************************************************************/
// Some portions generated by Copilot (Opus 5).
/**************************************************************************/ /**************************************************************************/
/**************************************************************************/ /**************************************************************************/
@@ -270,7 +271,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -287,7 +288,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
@@ -678,7 +679,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -695,7 +696,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
@@ -9,6 +9,7 @@
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
**************************************************************************/ **************************************************************************/
// Some portions generated by Copilot (Opus 5).
/**************************************************************************/ /**************************************************************************/
/**************************************************************************/ /**************************************************************************/
@@ -270,7 +271,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -287,7 +288,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
@@ -678,7 +679,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -695,7 +696,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
@@ -9,6 +9,7 @@
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
**************************************************************************/ **************************************************************************/
// Some portions generated by Copilot (Opus 5).
/**************************************************************************/ /**************************************************************************/
/**************************************************************************/ /**************************************************************************/
@@ -270,7 +271,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -287,7 +288,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
@@ -678,7 +679,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -695,7 +696,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
@@ -9,6 +9,7 @@
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
**************************************************************************/ **************************************************************************/
// Some portions generated by Copilot (Opus 5).
/**************************************************************************/ /**************************************************************************/
/**************************************************************************/ /**************************************************************************/
@@ -270,7 +271,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -287,7 +288,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
@@ -678,7 +679,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -695,7 +696,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
@@ -9,6 +9,7 @@
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
**************************************************************************/ **************************************************************************/
// Some portions generated by Copilot (Opus 5).
/**************************************************************************/ /**************************************************************************/
/**************************************************************************/ /**************************************************************************/
@@ -270,7 +271,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -287,7 +288,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */
@@ -678,7 +679,7 @@ TX_MUTEX *mutex_ptr;
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++]; mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
/* Check for wrap-around on the next free mutex. */ /* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK) if (__tx_iar_file_lock_next_free_mutex >= _MAX_FLOCK)
{ {
/* Yes, set the free index back to 0. */ /* Yes, set the free index back to 0. */
@@ -695,7 +696,7 @@ TX_MUTEX *mutex_ptr;
} }
/* Determine if a free mutex was found. */ /* Determine if a free mutex was found. */
if (i >= _MAX_LOCK) if (i >= _MAX_FLOCK)
{ {
/* Error! No more free mutexes! */ /* Error! No more free mutexes! */