From: Simon Kuenzer Date: Wed, 8 Jan 2020 09:14:50 +0000 (+0100) Subject: Use Unikraft initcall for initialization X-Git-Tag: RELEASE-0.4~1 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=1888b18993483830d240ea9b48818b10fbd96789;p=unikraft%2Flibs%2Fpthread-embedded.git 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 --- 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) {