Skip to content

Commit

Permalink
Set priority to pthread constructor
Browse files Browse the repository at this point in the history
Other libraries might use the default constructor attribute and expect pthreads
to be initialised. Currently, the priority for pthread-embedded library
constructor has the highest priority (101).

Signed-off-by: Vlad-Andrei Badoiu <[email protected]>
Reviewed-by: Costin Lupu <[email protected]>
  • Loading branch information
vladandrew authored and clupuishere committed Nov 1, 2019
1 parent 97d2dd1 commit b487eae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pte_osal.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#include <string.h>
#include <uk/essentials.h>
#include <uk/ctors_prio.h>
#include <uk/arch/time.h>
#include <uk/arch/atomic.h>
#include <uk/print.h>
Expand Down Expand Up @@ -58,7 +59,8 @@ typedef struct {
*
***************************************************************************/

int __constructor pthread_constructor(void)
UK_CTOR_ATTR(UK_CTOR_PRIO_PTHREAD_EMBEDDED)
int pthread_constructor(void)
{
uk_pr_debug("pthread-embedded constructor\n");
return pthread_init();
Expand Down

0 comments on commit b487eae

Please sign in to comment.