2
UINT tx_thread_create(TX_THREAD *thread_ptr, CHAR *name_ptr, 
                      VOID (*entry_function)(ULONG), ULONG entry_input, 
                      VOID *stack_start, ULONG stack_size, UINT priority,
                      UINT preempt_threshold, ULONG time_slice, 
                      UINT auto_start)

Documentation:
tx_thread_create documentation

If I need to pass more than one parameter to the entry_function I must necessarily use a void *, hence my question, why ThreadX uses a ULONG instead of a void * like FreeRTOS does?

20
  • 2
    Ask the authors. I guess when they started development they thought that the integer would be enough. Then they had to carry on Commented Oct 1, 2024 at 15:53
  • @0___________ I hope they have a more plausible explanation, I mean it cost nothing to use VOID *, like they did for the stack_start parameter. Commented Oct 1, 2024 at 16:00
  • ULONG is the argument to the thread entry function - the type of the pointer is VOID (*entry_function)(ULONG). Commented Oct 1, 2024 at 16:03
  • 1
    @500-InternalServerError he is asking why it is ULONG and not void *. It is obvious that both have to to have the same type :) Commented Oct 1, 2024 at 16:05
  • @500-InternalServerError I know that, my question is why use a ULONG instead of a void *? I would expect something like that UINT tx_thread_create(TX_THREAD *thread_ptr, CHAR *name_ptr, VOID (*entry_function)(VOID *), VOID *entry_input, VOID *stack_start, ULONG stack_size, UINT priority, UINT preempt_threshold, ULONG time_slice, UINT auto_start) Commented Oct 1, 2024 at 16:06

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.