4 Replies Latest reply on Jan 8, 2019 8:23 AM by SeSh_3921701

    How to initialize a mutex statically on WICED platform?

    SeSh_3921701

      Hi!

       

      There's some part of the code I'm dealing with that needs the mutex to be initialized statically:

      static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
      

       

      Is there any way to recreate such thing on WICED platform?

       

      I have included wiced_rtos.h to have access to the wiced_mutex_t definition and added appropriate typedef:

      typedef wiced_mutex_t pthread_mutex_t;
      

       

      Header inclusion and typedef work fine, but static mutex initialization gives the error about undeclared PTHREAD_MUTEX_INITIALIZER.

       

      Thanks in advance for the response!