lkml.org 
[lkml]   [2020]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC] eventfd: add EFD_AUTORESET flag
From
Date
On 29/01/20 18:20, Stefan Hajnoczi wrote:
> + /* Semaphore semantics don't make sense when autoreset is enabled */
> + if ((flags & EFD_SEMAPHORE) && (flags & EFD_AUTORESET))
> + return -EINVAL;
> +

I think they do, you just want to subtract 1 instead of setting the
count to 0. This way, writing 1 would be the post operation on the
semaphore, while poll() would be the wait operation.

Paolo

\
 
 \ /
  Last update: 2020-02-12 09:32    [W:0.094 / U:0.740 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site