[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCH v3 12/12] lib/uksched: Add private field for user


  • To: minios-devel@xxxxxxxxxxxxx
  • From: Costin Lupu <costin.lupu@xxxxxxxxx>
  • Date: Fri, 22 Mar 2019 17:16:01 +0200
  • Cc: Florian.Schmidt@xxxxxxxxx
  • Delivery-date: Fri, 22 Mar 2019 15:16:55 +0000
  • Ironport-phdr: 9a23:+gAjIhynMn/v1SjXCy+O+j09IxM/srCxBDY+r6Qd2+sfIJqq85mqBkHD//Il1AaPAdyDra0dwLWN+4nbGkU4qa6bt34DdJEeHzQksu4x2zIaPcieFEfgJ+TrZSFpVO5LVVti4m3peRMNQJW2aFLduGC94iAPERvjKwV1Ov71GonPhMiryuy+4ZLebxhUiDanY75+MRq6oAffu8ILnYZsN6E9xwfTrHBVYepW32RoJVySnxb4+Mi9+YNo/jpTtfw86cNOSL32cKskQ7NWCjQmKH0169bwtRbfVwuP52ATXXsQnxFVHgXK9hD6XpP2sivnqupw3TSRMMPqQbwoXzmp8qFmQwLqhigaLT406GHZhNJtgqxVoxyvoB5ww4DPbY2JKPZzZL/RcMkGSWZdWMtaSixPApm7b4sKF+cMI+FYr5Lhp1sPqxu1GA+iBP73yj9Vm3T72rE10+M6EQHa3QwgGcgCsHDJrNXtKacfSvy6zLLSwTXbcvNZwi3x6JLPch04p/yHQLF+cdLJxEUyGA7Jk0+cpI/lMj+PyOgBrWqW4/BuWO63lmIqpBx9riKsy8oskIXFmIwYx17e+Slkz4s5O9u1Q1Nhb9G+CptfrSSaOpNzQsMlXm5npj43yqYDuZ6nZCgKz4knxwLHZ/yHbYeI5hXjWf6PITd9nn1leba/iwyu/ki70OH8TtS0301QoipfldnArnEN1xrN5cibUvZx40is1SuV2w3Q6uxIO144mbTZJpI7zLM8jp8Tvl7CHi/ylkX2lqiWdkA89+e07OTneanmpp6aN4NujgH+L7wumtGkDOskKQgCRXCb+fmn27H55035R61GjucqnanBrJDaOcMbq7a8Aw9U1IYj6hG/Dyy/3NsFg3YHMkxKeBacgojtOlHOO+z4Deylj1WjjjhrwerKPrr7ApXCNnLDiqvufa5h605Azwo+1dBR55ZTCrEbIfL8QEnxuMbFABAlMwy0xufnB8hh1o4FX2KAHLOWMKfIvlCT/O4gPfSMN8cpv2P4Kv4k4OWrgXInlFs1eaiywYBReH2+WPN8LBa3e33p1/wGCnsLuEIaUfT3wAmJViVPZnD0W78k+xkwE8S+EI2FXIf70+/J5zuyApADPjMOMVuLC3q9L4g=
  • Ironport-sdr: yF2aaypYVFnt3BKfA70U64/OuyaPwrZISC6oBD5lzZxddvo2AUdIMV4xfu7Ho5JXH1qOjsO9DN tq7KvtWOPVeg==
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>

The private field may be used by the user for holding its private
information in scheduling frameworks which would wrap the Unikraft
scheduling functionality. One such example might be the pthread library
which would set the private field as a back pointer to its pthread_t
data. This is especially useful when implementing pthread_self() by
calling uk_thread_current().

Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
Reviewed-by: Florian Schmidt <florian.schmidt@xxxxxxxxx>
---
 lib/uksched/include/uk/thread.h | 1 +
 lib/uksched/thread.c            | 1 +
 2 files changed, 2 insertions(+)

diff --git a/lib/uksched/include/uk/thread.h b/lib/uksched/include/uk/thread.h
index f8bdbb5e..71e39225 100644
--- a/lib/uksched/include/uk/thread.h
+++ b/lib/uksched/include/uk/thread.h
@@ -57,6 +57,7 @@ struct uk_thread {
        bool detached;
        struct uk_waitq waiting_threads;
        struct uk_sched *sched;
+       void *prv;
 #ifdef CONFIG_LIBNEWLIBC
        struct _reent reent;
 #endif
diff --git a/lib/uksched/thread.c b/lib/uksched/thread.c
index 72adfc68..7400baee 100644
--- a/lib/uksched/thread.c
+++ b/lib/uksched/thread.c
@@ -115,6 +115,7 @@ int uk_thread_init(struct uk_thread *thread,
        thread->detached = false;
        uk_waitq_init(&thread->waiting_threads);
        thread->sched = NULL;
+       thread->prv = NULL;
 
 #ifdef CONFIG_LIBNEWLIBC
        reent_init(&thread->reent);
-- 
2.11.0


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.