|
| From: | Paolo Bonzini |
| Subject: | [Qemu-devel] Re: [PATCHv6 03/11] notifier: event notifier implementation |
| Date: | Fri, 02 Apr 2010 16:53:07 +0200 |
| User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.8) Gecko/20100301 Fedora/3.0.3-1.fc12 Lightning/1.0b2pre Thunderbird/3.0.3 |
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
| [Prev in Thread] | Current Thread | [Next in Thread] |