[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: Sun, 10 Mar 2019 22:10:05 +0200
- Cc: Florian.Schmidt@xxxxxxxxx, simon.kuenzer@xxxxxxxxx, yuri.volchkov@xxxxxxxxx, sharan.santhanam@xxxxxxxxx
- Delivery-date: Sun, 10 Mar 2019 20:10:21 +0000
- Ironport-phdr: 9a23:41Dw5BGhrH0o5IRHvM80F51GYnF86YWxBRYc798ds5kLTJ76p8y4bnLW6fgltlLVR4KTs6sC17OO9fi5EUU7or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6arXK99yMdFQviPgRpOOv1BpTSj8Oq3Oyu5pHfeQpFiCehbb9oMBm6sBjau9ULj4dlNqs/0AbCrGFSe+RRy2NoJFaTkAj568yt4pNt8Dletuw4+cJYXqr0Y6o3TbpDDDQ7KG81/9HktQPCTQSU+HQRVHgdnwdSDAjE6BH6WYrxsjf/u+Fg1iSWIdH6QLYpUjmk8qxlSgLniD0fOjA57m/Zl8J+gqFcrh2jqRxy2JLYbJ2POfZiZK7RYc8WSGxcVchRTSxBBYa8YpMRAuoGJuZYs4j9p10TphW4GAmsHP7vwSJPi3Dq2q06yPghEQDA3AA6G9IOrWzUrMjuOagOSuC51rHIzSjYYP9Mwzf975HFfxY8qv+PRbJ9adfdxEYyGw/fjVidqZbpMy2L2ukPqWSW4fJsWf+ghmI6sQ18oTiiyt0yhoTHiI8Z0E3I+CpnzIszONa2UlR0YcS+H5tVryyaMox2Td48TGxwoyY6z6EGuYa8fCgX1JQr3x7fZOKDc4iP+h/jSuORLi15hHJhYr6wmw2y/VK4yu3hTca4ykxKri1dntnNsHACyQDT59CaRvZy40utwzWC2gDJ5u1aP0w5l7DXJpA5zr41jJUTsEDDHiHsmEXxia+bblkr+u+z6+T7Y7XmoIWQN4tpigHmL6QjgdCwAf8iPggWQmiU4v6w1Kfk/UHhWrVFkuU2krXFsJDdPckbo6+5AwlU0oYk8BazFiqp38oGnXYZKFJIYxaHj4nyO1HSO/D0F/i+jEqqkDtxwPDGJLLhCI3XLnffiLfhYap960lExQQzydBf4IhUCrAbL/L1QEP/qcDXDh88Mwy13unnFM5w1oUAVm2TBq+WKrjdvUWW6eIyO+OMfpMauC7hK/g54P7jlWQ5mV8Hcqmzx5QXbmq0Hu98LEWffXrsgs0OEWEQsQo7V+HqjkONXiJXZ3moRK0w/C80CJ++B4fZWo+tmKCB3Du8HpBOfWBGC1WMEXDud4meWPcMdTydIslgkzMaT7isUIkh2g+yuw/+0bVoNfDY9TMFtZj7zth6+/XTlQ0u9TxzF8mc03yNT3t1nm8SWT8226R/rlB9yleA1qh4nedVFdpN6PxVVgc1L4XTw/ZkBNDvCUr9eYKMSVCnRc7jDTwvQ9YZx94Vf107C9ikyBfZ0HmEGbgQwpeMH4A19Or4wmDsb5J2zG3a1a9ni0Q+X+NELiu+m6Q57Q+FVN2BqFmQi6v/LfdU5yXK7mrWlWc=
- Ironport-sdr: v7HWe7ewIAQYtlvRNo6BXJ+L5E7/KtqzQpQfh69NFflLMUSlyO9iOnBv2AQKQILozpj+BerZWK MtNb7O9/FUaw==
- 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>
---
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 64fe6a2b..f85a652e 100644
--- a/lib/uksched/thread.c
+++ b/lib/uksched/thread.c
@@ -114,6 +114,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
|