summaryrefslogtreecommitdiff
path: root/utility
diff options
context:
space:
mode:
authorYuxin Zhou <[email protected]>2022-01-29 00:24:03 +0000
committerYuxin Zhou <[email protected]>2022-01-29 00:24:03 +0000
commitf7f0957188d48ec5278107dc8fbd2de747fda1b8 (patch)
treefee9f4baf5a6a8bb944c5de8ad10fda300027d26 /utility
parentb216ceb25e2b6ae1ea83c1ae91d114a6fc2fc4ec (diff)
Release 6.1.10
Diffstat (limited to 'utility')
-rw-r--r--utility/rtos_compatibility_layers/FreeRTOS/tx_freertos.c54
1 files changed, 22 insertions, 32 deletions
diff --git a/utility/rtos_compatibility_layers/FreeRTOS/tx_freertos.c b/utility/rtos_compatibility_layers/FreeRTOS/tx_freertos.c
index 5f7955f5..ee617a59 100644
--- a/utility/rtos_compatibility_layers/FreeRTOS/tx_freertos.c
+++ b/utility/rtos_compatibility_layers/FreeRTOS/tx_freertos.c
@@ -26,6 +26,9 @@
/* 10-15-2021 William E. Lamie Modified comment(s), and */
/* fixed compiler warnings, */
/* resulting in version 6.1.7 */
+/* 01-31-2022 William E. Lamie Modified comment(s), and */
+/* fixed compiler warnings, */
+/* resulting in version 6.1.10 */
/* */
/**************************************************************************/
@@ -1334,43 +1337,30 @@ BaseType_t xSemaphoreGive(SemaphoreHandle_t xSemaphore)
configASSERT(xSemaphore != NULL);
-
- if(xSemaphore->p_set != NULL) {
- TX_DISABLE;
- _tx_thread_preempt_disable++;
- }
-
if(xSemaphore->is_mutex == 1u) {
ret = tx_mutex_put(&xSemaphore->mutex);
if(ret != TX_SUCCESS) {
return pdFALSE;
}
- } else {
- if(xSemaphore->p_set == NULL) {
- TX_DISABLE;
- _tx_thread_preempt_disable++;
- }
- if(xSemaphore->sem.tx_semaphore_count >= xSemaphore->max_count) {
- /* Maximum semaphore count reached return failure. */
- _tx_thread_preempt_disable--;
- TX_RESTORE
- return pdFALSE;
- }
+ return pdTRUE;
+ }
- ret = tx_semaphore_put(&xSemaphore->sem);
- if(ret != TX_SUCCESS) {
- _tx_thread_preempt_disable--;
- TX_RESTORE;
- return pdFALSE;
- }
+ TX_DISABLE;
+ _tx_thread_preempt_disable++;
- if(xSemaphore->p_set == NULL) {
- _tx_thread_preempt_disable--;
- TX_RESTORE;
+ if(xSemaphore->sem.tx_semaphore_count >= xSemaphore->max_count) {
+ /* Maximum semaphore count reached return failure. */
+ _tx_thread_preempt_disable--;
+ TX_RESTORE
+ return pdFALSE;
+ }
- _tx_thread_system_preempt_check();
- }
+ ret = tx_semaphore_put(&xSemaphore->sem);
+ if(ret != TX_SUCCESS) {
+ _tx_thread_preempt_disable--;
+ TX_RESTORE;
+ return pdFALSE;
}
if(xSemaphore->p_set != NULL) {
@@ -1383,12 +1373,12 @@ BaseType_t xSemaphoreGive(SemaphoreHandle_t xSemaphore)
TX_FREERTOS_ASSERT_FAIL();
return pdFALSE;
}
+ }
- _tx_thread_preempt_disable--;
- TX_RESTORE;
+ _tx_thread_preempt_disable--;
+ TX_RESTORE;
- _tx_thread_system_preempt_check();
- }
+ _tx_thread_system_preempt_check();
return pdTRUE;
}