From 1888b18993483830d240ea9b48818b10fbd96789 Mon Sep 17 00:00:00 2001 From: Simon Kuenzer Date: Wed, 8 Jan 2020 10:14:50 +0100 Subject: [PATCH] Use Unikraft initcall for initialization Initialize the library by using an Unikraft initcall instead of the constructor attribute. This is to make sure that pthread-embedded is initialized before Unikraft calls any application constructors and after Unikraft initialized the depending scheduler. Signed-off-by: Simon Kuenzer Reviewed-by: Sharan Santhanam --- pte_osal.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pte_osal.c b/pte_osal.c index 3ce2a8c..cfd5b3b 100644 --- a/pte_osal.c +++ b/pte_osal.c @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include #include @@ -59,12 +59,12 @@ typedef struct { * ***************************************************************************/ -UK_CTOR_ATTR(UK_CTOR_PRIO_PTHREAD_EMBEDDED) -int pthread_constructor(void) +static int pthread_initcall(void) { - uk_pr_debug("pthread-embedded constructor\n"); + uk_pr_debug("Initialize pthread-embedded\n"); return pthread_init(); } +uk_lib_initcall(pthread_initcall); pte_osResult pte_osInit(void) { -- 2.39.5