[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 Florian,

On 3/21/19 2:59 PM, Florian Schmidt wrote:
> 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?
>

It's fine with me. It won't break anything.

>> +
>> +    uk_waitq_wait_event(&thread->waiting_threads, is_exited(thread));
>> +
>> +    thread->detached = true;
>> +
>> +    uk_sched_thread_destroy(thread->sched, thread);
>> +
>> +    return 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®.