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

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


  • To: minios-devel@xxxxxxxxxxxxx
  • From: Costin Lupu <costin.lupu@xxxxxxxxx>
  • Date: Fri, 22 Mar 2019 16:16:39 +0200
  • Cc: Florian.Schmidt@xxxxxxxxx
  • Delivery-date: Fri, 22 Mar 2019 14:16:53 +0000
  • Ironport-phdr: 9a23:XatxZxHhfp7SoZMIOfeBH51GYnF86YWxBRYc798ds5kLTJ7zpsWwAkXT6L1XgUPTWs2DsrQY0rKQ7PmrBDNIyK3CmUhKSIZLWR4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TW94jEIBxrwKxd+KPjrFY7OlcS30P2594HObwlSizexfK9+IA+0oAnMucUbgYlvIbstxxXUpXdFZ/5Yzn5yK1KJmBb86Maw/Jp9/ClVpvks6c1OX7jkcqohVbBXAygoPG4z5M3wqBnMVhCP6WcGUmUXiRVHHQ7I5wznU5jrsyv6su192DSGPcDzULs5Vyiu47ttRRT1jioMKjw3/3zNisFojKxVvg+vqRJ8zYDTYo6VOuFzcr/Bcd4AWWZMRNpdWzBHD4ihb4UPFe0BPeNAooTjoFsOtge+BQiqBOjyzDFIm2f23bAn2OkmDQ7G2xcgH84PsHTSttn1MLoSUfiozKTT0TrDdOla2S/g6IfTaBwhu/aMUKt2fMHMykcvDxvIgkifpID4JT+Y1eQAv3KF4+Z+V++jkWAqpxlsrjWg28sgkIrEi4IPxlza+yh0zpw5KcC3RUJlZ9OvDYFeuDuAN4RsR8MvW2RouCEnxbIYoZO7Zy0KyIg/xx7YdvyHb5CE4hL9W+aVJjd1nGxleLeliBaz9Uis0PHzVtKu3FZSsypKicPAtmoK1xDL68iHTOVy/lu51DqS2A3f9/tILEM0mKbBNZIt3Lw9moAdvEjbGy/5gkT2jKuYdkU+/eio7vzqbanhpp+HK490iwf+Pr4qmsyiGeQ4LxMDUHSA+eimzL3j4Fb2TK9Qjv0xiqXZqozVJdwHpq6lBA9YyoMj6xe5Dzen19QYhmALI09bdxKZkYfpP0rDIPT5Dfekn1Ssiy1nxv/YMb3nGJnNKWLDkLj5d7Zn90Fc0BYzzcxY559MCr8BJPXzWlXwtNPCCB81KRG6zPrnCNV414MRRH6PD7SfMKzMrVCI4vggLPKWaIALpTauY8Qisvvvi34+ghoRcLek2bMTaWukBbJ2LkPfZmDj0fkbFmJflQ0lUO3swHmfSSMbM321RL494Hc/FZq7JYzYAJiwivqb23HoTdVtemlaBwXUQj/TfIKeVqJUZQ==
  • Ironport-sdr: y8HnSEXUckGk57AsBwZrmi788bC1yN+Oy5DKHQ0JgfYSPK+YqOKBSQDTkousj10XtolJX2CWIj 8Ai3ESGnZDUg==
  • 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®.