|
The Pedigree Project 0.1
|
#include <eventfd-syscalls.h>
Inheritance diagram for EventFd:
Collaboration diagram for EventFd:Public Member Functions | |
| EventFd (uint64_t initialValue, bool semaphoreMode) | |
| int | readValue (uint64_t &value, bool canBlock) |
| int | writeValue (uint64_t value, bool canBlock) |
| ReadyMask | queryReady () |
| ReadinessGenerations | readinessGenerations () override |
| uint64_t | writeGeneration () const |
| MUST_USE_RESULT bool | addDescriptorOwner () |
| void | removeDescriptorOwner () |
Public Member Functions inherited from ReadinessSource | |
| MUST_USE_RESULT bool | subscribeReadiness (ReadyMask interest, const SharedPointer< ReadinessObserver > &observer, ReadinessSubscription &subscription) |
Private Member Functions | |
| EventFd (const EventFd &)=delete | |
| EventFd & | operator= (const EventFd &)=delete |
Private Attributes | |
| Mutex | m_Lock |
| ConditionVariable | m_Readers |
| ConditionVariable | m_Writers |
| uint64_t | m_Counter |
| Atomic< uint64_t > | m_WriteGeneration |
| ReadinessGenerations | m_Generations |
| size_t | m_DescriptorOwners |
| bool | m_SemaphoreMode |
| bool | m_DescriptorAdmissionOpen |
Additional Inherited Members | |
Protected Member Functions inherited from ReadinessSource | |
| void | notifyReadiness (ReadyMask mask) |
| void | closeReadiness (ReadyMask mask=ReadyInvalid|ReadyHangup) |
A Linux eventfd counter shared by every alias of one open description.
Definition at line 26 of file eventfd-syscalls.h.
| EventFd::EventFd | ( | uint64_t | initialValue, |
| bool | semaphoreMode | ||
| ) |
Definition at line 32 of file eventfd-syscalls.cc.
|
override |
Definition at line 44 of file eventfd-syscalls.cc.
| bool EventFd::addDescriptorOwner | ( | ) |
Track descriptor-table aliases independently of in-flight syscall pins.
Definition at line 144 of file eventfd-syscalls.cc.
| ReadyMask EventFd::queryReady | ( | ) |
Return the current poll/epoll level.
Definition at line 123 of file eventfd-syscalls.cc.
|
overridevirtual |
Return source-serialized rising-edge sequences where available.
A source increments the corresponding sequence while holding the same lock which changes its readiness predicate. Consumers can then recover a drain/refill transition even if the two callback deliveries are reordered.
Reimplemented from ReadinessSource.
Definition at line 135 of file eventfd-syscalls.cc.
| int EventFd::readValue | ( | uint64_t & | value, |
| bool | canBlock | ||
| ) |
Read one eventfd value, blocking while the counter is zero if allowed.
Definition at line 49 of file eventfd-syscalls.cc.
References Semaphore::acquire(), ConditionVariable::broadcast(), ConditionVariable::mutexAcquired(), ReadinessSource::notifyReadiness(), Semaphore::release(), and ConditionVariable::wait().
| void EventFd::removeDescriptorOwner | ( | ) |
Definition at line 153 of file eventfd-syscalls.cc.
| uint64_t EventFd::writeGeneration | ( | ) | const |
Monotonically identifies every successful producer write for EPOLLET.
Definition at line 140 of file eventfd-syscalls.cc.
| int EventFd::writeValue | ( | uint64_t | value, |
| bool | canBlock | ||
| ) |
Add one eventfd value, blocking while it would overflow if allowed.
Definition at line 86 of file eventfd-syscalls.cc.
References Semaphore::acquire(), ConditionVariable::broadcast(), ConditionVariable::mutexAcquired(), ReadinessSource::notifyReadiness(), Semaphore::release(), and ConditionVariable::wait().
|
private |
Definition at line 56 of file eventfd-syscalls.h.
|
private |
Definition at line 61 of file eventfd-syscalls.h.
|
private |
Definition at line 59 of file eventfd-syscalls.h.
|
private |
Definition at line 58 of file eventfd-syscalls.h.
|
private |
Definition at line 53 of file eventfd-syscalls.h.
|
private |
Definition at line 54 of file eventfd-syscalls.h.
|
private |
Definition at line 60 of file eventfd-syscalls.h.
|
private |
Definition at line 57 of file eventfd-syscalls.h.
|
private |
Definition at line 55 of file eventfd-syscalls.h.