cancel
Showing results for 
Search instead for 
Did you mean: 

WICED Studio Wi-Fi Combo

New Contributor II

Hello.

 

I write this code.

 

#include "wiced.h"

static wiced_thread_t xt;
static void x(uint args);

static void x(uint args)
{
          WPRINT_APP_INFO( ("[x] running\n") );
}

void application_start(void)
{
          UINT status;

          /* Initializes the WICED system */
          wiced_init ( );

 

          for(int m = 0;m<10;m++)
          {
                  WPRINT_APP_INFO( ("\nCreate thread #%d ...\n", m) );

                  status = wiced_rtos_create_thread ( &xt, WICED_APPLICATION_PRIORITY, "x", (wiced_thread_function_t)&x, 1024, NULL );

                  if ( status != WICED_SUCCESS )
                  {
                          WPRINT_APP_INFO( ("wiced_rtos_create_thread 'x' failed, status = %d\n", status) );
                  }

                  wiced_rtos_delay_milliseconds ( 1000 );
          }
}

 

The first iteration of the "for" cycle creates thread successfully.

The subsequents iterations returns "wiced_rtos_create_thread 'x' failed, status = 1031"

1031 is THREAD_CREATE_FAILED.

 

I dont' understand ... I believe that in 1 seconds the 'x' thread finished because it has only to PRINT a simple string, so duration is less than 1 seconds. So I believe that ThreadX can create new thread with the same "static wiced_thread_t xt;".

 

0 Likes
Reply
0 Replies