]> xenbits.xensource.com Git - unikraft/libs/pthread-embedded.git/commitdiff
Set priority to pthread constructor
authorVlad-Andrei BĂDOIU (78692) <vlad_andrei.badoiu@stud.acs.upb.ro>
Wed, 30 Oct 2019 22:37:58 +0000 (22:37 +0000)
committerCostin Lupu <costin.lupu@cs.pub.ro>
Fri, 1 Nov 2019 06:56:36 +0000 (08:56 +0200)
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 <vlad_andrei.badoiu@stud.acs.upb.ro>
Reviewed-by: Costin Lupu <costin.lupu@cs.pub.ro>
pte_osal.c

index 23dcd01559af2982ac1d5743a0415095eec55301..3ce2a8c3b3fff20c5af96db2f53cdad87d404860 100644 (file)
@@ -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>
@@ -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();