summaryrefslogtreecommitdiff
path: root/utility/rtos_compatibility_layers/posix/px_pth_create.c
diff options
context:
space:
mode:
Diffstat (limited to 'utility/rtos_compatibility_layers/posix/px_pth_create.c')
-rw-r--r--utility/rtos_compatibility_layers/posix/px_pth_create.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/utility/rtos_compatibility_layers/posix/px_pth_create.c b/utility/rtos_compatibility_layers/posix/px_pth_create.c
index 511026db..60b79f84 100644
--- a/utility/rtos_compatibility_layers/posix/px_pth_create.c
+++ b/utility/rtos_compatibility_layers/posix/px_pth_create.c
@@ -32,7 +32,7 @@
/* FUNCTION RELEASE */
/* */
/* pthread_create PORTABLE C */
-/* 6.1.7 */
+/* 6.2.0 */
/* AUTHOR */
/* */
/* William E. Lamie, Microsoft Corporation */
@@ -98,7 +98,10 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
-/* 06-02-2021 William E. Lamie Initial Version 6.1.7 */
+/* 06-02-2021 William E. Lamie Initial Version 6.1.7 */
+/* 10-31-2022 Scott Larson Add 64-bit support, */
+/* remove double parenthesis, */
+/* resulting in version 6.2.0 */
/* */
/**************************************************************************/
INT pthread_create (pthread_t *thread, pthread_attr_t *attr,
@@ -211,7 +214,7 @@ INT status,retval;
status = posix_memory_allocate( pthread_ptr->stack_size, &(pthread_ptr->stack_address));
/* problem allocating stack space */
- if ((status == ERROR))
+ if (status == ERROR)
{
/* Configuration/resource error. */
return(EAGAIN);
@@ -227,17 +230,19 @@ INT status,retval;
/* Now actually create and start the thread. */
/* convert Posix priorities to Threadx priority */
- retval += tx_thread_create( thread_ptr,
+ retval += tx_thread_create(thread_ptr,
"pthr",
posix_thread_wrapper,
- (ULONG)pthread_ptr,
+ (ULONG)(ALIGN_TYPE)pthread_ptr,
pthread_ptr->stack_address,
pthread_ptr->stack_size,
(TX_LOWEST_PRIORITY - pthread_ptr->current_priority + 1),
(TX_LOWEST_PRIORITY - pthread_ptr->threshold + 1),
pthread_ptr->time_slice,
TX_AUTO_START);
-
+
+ TX_THREAD_EXTENSION_PTR_SET(thread_ptr, pthread_ptr)
+
/* See if ThreadX encountered an error */
if (retval)
{