diff options
| author | Yuxin Zhou <[email protected]> | 2021-10-14 00:51:26 +0000 |
|---|---|---|
| committer | Yuxin Zhou <[email protected]> | 2021-10-14 00:51:26 +0000 |
| commit | 1af8404c54f9c8d3caa2ac3523c2a5f014aecb1c (patch) | |
| tree | 93e4f4d64ec8c21c01b77f19b8e7326e85227e3d /common_smp/src/tx_byte_pool_delete.c | |
| parent | 215df45d4b59d4ce8606a88f566d1d426e64a84c (diff) | |
Release 6.1.9
Diffstat (limited to 'common_smp/src/tx_byte_pool_delete.c')
| -rw-r--r-- | common_smp/src/tx_byte_pool_delete.c | 96 |
1 files changed, 49 insertions, 47 deletions
diff --git a/common_smp/src/tx_byte_pool_delete.c b/common_smp/src/tx_byte_pool_delete.c index 8595ec1f..1d8a3fa7 100644 --- a/common_smp/src/tx_byte_pool_delete.c +++ b/common_smp/src/tx_byte_pool_delete.c @@ -12,8 +12,8 @@ /**************************************************************************/ /**************************************************************************/ -/** */ -/** ThreadX Component */ +/** */ +/** ThreadX Component */ /** */ /** Byte Pool */ /** */ @@ -31,49 +31,51 @@ #include "tx_byte_pool.h" -/**************************************************************************/ -/* */ -/* FUNCTION RELEASE */ -/* */ -/* _tx_byte_pool_delete PORTABLE C */ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_byte_pool_delete PORTABLE C */ /* 6.1 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ /* */ /* DESCRIPTION */ -/* */ -/* This function deletes the specified byte pool. All threads */ -/* suspended on the byte pool are resumed with the TX_DELETED status */ -/* code. */ -/* */ -/* It is important to note that the byte pool being deleted, or the */ -/* memory associated with it should not be in use when this function */ -/* is called. */ -/* */ -/* INPUT */ -/* */ -/* pool_ptr Pointer to pool control block */ -/* */ -/* OUTPUT */ -/* */ -/* TX_SUCCESS Successful completion status */ -/* */ -/* CALLS */ -/* */ -/* _tx_thread_system_preempt_check Check for preemption */ -/* _tx_thread_system_resume Resume thread service */ -/* _tx_thread_system_ni_resume Non-interruptable resume thread */ -/* */ -/* CALLED BY */ -/* */ -/* Application Code */ -/* */ -/* RELEASE HISTORY */ -/* */ +/* */ +/* This function deletes the specified byte pool. All threads */ +/* suspended on the byte pool are resumed with the TX_DELETED status */ +/* code. */ +/* */ +/* It is important to note that the byte pool being deleted, or the */ +/* memory associated with it should not be in use when this function */ +/* is called. */ +/* */ +/* INPUT */ +/* */ +/* pool_ptr Pointer to pool control block */ +/* */ +/* OUTPUT */ +/* */ +/* TX_SUCCESS Successful completion status */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_system_preempt_check Check for preemption */ +/* _tx_thread_system_resume Resume thread service */ +/* _tx_thread_system_ni_resume Non-interruptable resume thread */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 05-19-2020 William E. Lamie Initial Version 6.0 */ +/* 09-30-2020 Yuxin Zhou Modified comment(s), */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _tx_byte_pool_delete(TX_BYTE_POOL *pool_ptr) @@ -81,8 +83,8 @@ UINT _tx_byte_pool_delete(TX_BYTE_POOL *pool_ptr) TX_INTERRUPT_SAVE_AREA -TX_THREAD *thread_ptr; -TX_THREAD *next_thread; +TX_THREAD *thread_ptr; +TX_THREAD *next_thread; UINT suspended_count; TX_BYTE_POOL *next_pool; TX_BYTE_POOL *previous_pool; @@ -108,7 +110,7 @@ TX_BYTE_POOL *previous_pool; /* Decrement the number of byte pools created. */ _tx_byte_pool_created_count--; - + /* See if the byte pool is the only one on the list. */ if (_tx_byte_pool_created_count == TX_EMPTY) { @@ -128,9 +130,9 @@ TX_BYTE_POOL *previous_pool; /* See if we have to update the created list head pointer. */ if (_tx_byte_pool_created_ptr == pool_ptr) { - + /* Yes, move the head pointer to the next link. */ - _tx_byte_pool_created_ptr = next_pool; + _tx_byte_pool_created_ptr = next_pool; } } @@ -138,11 +140,11 @@ TX_BYTE_POOL *previous_pool; _tx_thread_preempt_disable++; /* Pickup the suspension information. */ - thread_ptr = pool_ptr -> tx_byte_pool_suspension_list; + thread_ptr = pool_ptr -> tx_byte_pool_suspension_list; pool_ptr -> tx_byte_pool_suspension_list = TX_NULL; suspended_count = pool_ptr -> tx_byte_pool_suspended_count; pool_ptr -> tx_byte_pool_suspended_count = TX_NO_SUSPENSIONS; - + /* Restore interrupts. */ TX_RESTORE @@ -150,14 +152,14 @@ TX_BYTE_POOL *previous_pool; on this byte pool. */ while (suspended_count != TX_NO_SUSPENSIONS) { - + /* Decrement the suspension count. */ suspended_count--; - + /* Lockout interrupts. */ TX_DISABLE - /* Clear the cleanup pointer, this prevents the timeout from doing + /* Clear the cleanup pointer, this prevents the timeout from doing anything. */ thread_ptr -> tx_thread_suspend_cleanup = TX_NULL; |
