The Open Master Hearing Aid (openMHA)
openMHA
Open community platform for hearing aid algorithm research
|
Abstract base class for synchronizing multithreaded (producer/consumer) fifo operations. More...
Public Member Functions | |
virtual void | aquire_mutex ()=0 |
Calling thread waits until it aquires the lock. More... | |
virtual void | release_mutex ()=0 |
Calling thread releases the lock. More... | |
virtual void | wait_for_decrease ()=0 |
Calling producer thread must own the lock. More... | |
virtual void | wait_for_increase ()=0 |
Calling consumer thread must own the lock. More... | |
virtual void | increment ()=0 |
To be called by producer thread after producing. More... | |
virtual void | decrement ()=0 |
To be called by consumer thread after consuming. More... | |
virtual | ~mha_fifo_thread_platform_t () |
Make destructor virtual. More... | |
mha_fifo_thread_platform_t () | |
Make default constructor accessible. More... | |
Private Member Functions | |
mha_fifo_thread_platform_t (const mha_fifo_thread_platform_t &) | |
mha_fifo_thread_platform_t & | operator= (const mha_fifo_thread_platform_t &) |
Abstract base class for synchronizing multithreaded (producer/consumer) fifo operations.
Works only with single producer and single consumer.
|
inlinevirtual |
Make destructor virtual.
|
private |
|
inline |
Make default constructor accessible.
|
pure virtual |
Calling thread waits until it aquires the lock.
Must not be called when the lock is already aquired.
Implemented in mha_fifo_posix_threads_t.
|
pure virtual |
Calling thread releases the lock.
May only be called when lock is owned.
Implemented in mha_fifo_posix_threads_t.
|
pure virtual |
Calling producer thread must own the lock.
Method releases lock, and waits for consumer thread to call decrease(). Then reaquires lock and returns
Implemented in mha_fifo_posix_threads_t.
|
pure virtual |
Calling consumer thread must own the lock.
Method releases lock, and waits for producer thread to call increase(). Then reaquires lock and returns
Implemented in mha_fifo_posix_threads_t.
|
pure virtual |
To be called by producer thread after producing.
Producer thread needs to own the lock to call this method.
Implemented in mha_fifo_posix_threads_t.
|
pure virtual |
To be called by consumer thread after consuming.
Consumer thread needs to own the lock to call this method.
Implemented in mha_fifo_posix_threads_t.
|
private |