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

Re: [Minios-devel] [UNIKRAFT PATCH v3 05/12] lib/uksched: Add support for waiting threads



Hi Costin,

the patch looks good. Just one tiny thing that I hadn't noticed before, but we can change that on upstreaming if you agree, see below.

Other than that:
Reviewed-by: Florian Schmidt <florian.schmidt@xxxxxxxxx>


On 3/10/19 9:09 PM, Costin Lupu wrote:
+int uk_thread_wait(struct uk_thread *thread)
+{
+       UK_ASSERT(thread);
+
+       /* TODO critical region */
+
+       if (thread->detached)
+               return -1;

I suggest to make this return value a bit clearer and verbose by returning -EINVAL instead of -1. I don't think that will break anything, considering the function is introduced in this patch, and no code inside unikraft itself is using it?

+
+       uk_waitq_wait_event(&thread->waiting_threads, is_exited(thread));
+
+       thread->detached = true;
+
+       uk_sched_thread_destroy(thread->sched, thread);
+
+       return 0;
+}
+

--
Dr. Florian Schmidt
フローリアン・シュミット
Research Scientist,
Systems and Machine Learning Group
NEC Laboratories Europe
Kurfürsten-Anlage 36, D-69115 Heidelberg
Tel.     +49 (0)6221 4342-265
Fax:     +49 (0)6221 4342-155
e-mail:  florian.schmidt@xxxxxxxxx
============================================================
Registered at Amtsgericht Mannheim, Germany, HRB728558

_______________________________________________
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®.