From b487eae8d93e7ad87f6b7ffac6055b5f14aacbaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vlad-Andrei=20B=C4=82DOIU=20=2878692=29?= Date: Wed, 30 Oct 2019 22:37:58 +0000 Subject: [PATCH] Set priority to pthread constructor 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 Reviewed-by: Costin Lupu --- pte_osal.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pte_osal.c b/pte_osal.c index 23dcd01..3ce2a8c 100644 --- a/pte_osal.c +++ b/pte_osal.c @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -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();