Real-Time Embedded Multithreading: Using ThreadX and ARM

The memory block pool services described in this appendix are:
| tx_block_allocate | Allocate a fixed-size block of memory |
| tx_block_pool_create | Create a pool of fixed-size memory blocks |
| tx_block_pool_delete | Delete pool of fixed-size memory blocks |
| tx_block_pool_info_get | Retrieve information about block pool |
| tx_block_pool_prioritize | Prioritize block pool suspension list |
| tx_block_release | Release a fixed-size block of memory |
Allocate a fixed-size block of memory
UINT <b class="bold">tx_block_allocate</b>(TX_BLOCK_POOL <b class="bold">*pool_ptr</b>, VOID <b class="bold">**block_ptr</b>, ULONG <b class="bold">wait_option</b>)
This service allocates a fixed-size memory block from the specified memory pool. The actual size of the memory block is determined during memory pool creation. This service modifies the Memory Block Pool Control Block through the parameter pool_ptr.
| pool_ptr | Pointer to a previously created pool s memory Control Block. |
| block_ptr | Pointer to a destination block pointer. On successful allocation, the address of the allocated memory block is placed where this parameter points to. |
| wait_option | Defines how the service behaves if no memory blocks are available. The wait options are defined as follows: |
| TX_NO_WAIT (0x00000000) | |
| TX_WAIT_FOREVER (0xFFFFFFFF) | |
| timeout value (0x00000001 to 0xFFFFFFFE, inclusive) | |
| Selecting TX_NO_WAIT results in an immediate return from this service regardless of whether or not it was successful. This is the only valid option if the service is called from a non-thread; e.g., initialization, timer, or ISR. Selecting TX_WAIT_FOREVER causes the calling thread to suspend... |