On 03/17/2010 12:07 PM, Michael S. Tsirkin wrote:
+{
+#ifdef CONFIG_EVENTFD
+ int fd = eventfd(!!active, EFD_NONBLOCK | EFD_CLOEXEC);
+ uint64_t value;
+ int r = read(e->fd,&value, sizeof(value));
+ if (r == sizeof(value)) {
+ /* restore previous value. */
+ int s = write(e->fd,&value, sizeof(value));
+ /* never blocks because we use EFD_SEMAPHORE.
No, we don't...
Also, it seems like this function as it is written now requires blocking
operation of the eventfd, otherwise it would not be atomic when another
thread calls event_notifier_test_and_clear. Which makes everything more
complicated.
But after all is unused, maybe it should be zapped?
Paolo