-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add startTransfer() and transferCounter to DeviceModule #131
Comments
SharedLock does not work. I would have to set the unique lock which is held inside the DeviceModuleThread when reporting the exception from another thread. The only solution is a condition variable, which is already there: deviceHasError |
I updated the ticket description accordingly. Note that the specification is not 100 % up to date. It still mentions a shared lock. |
Notice: The tests will only succeed if #130 is implemented. This ticket does otherwise not depend on it, so it can already be started. |
The functions startTransfer() and stopTransfer(). The concept has been put into the specification and has been implemented. |
Child of #123
Implement after #129
The exception handling scheme requires a mechanism that prevents the ExceptionHandlingDecorators to start a transfer if the device is in error state. Especially after opening the device, where the accessors are already functional, no access must happen before the initialisation sequence is done and the recovery accessors have been written.
This ticket provides the interface in the DeviceModule to be able to implement this in the ExceptionHandlingDecorator.
Scheme
deviceHasError
is used.true
in reportException, which is called by the ExceptionHandlingDecorator in its thread (already there).false
by the DeviceModule after successful recovery (already there).waitForRecovery()
which allows to wait for the flag to change.errorIsResolvedCondVar
anderrorIsReportedCondVar
, and a common mutexerrorMutex
. The common predicate for the condition variables isdeviceHasError
.the
deviceHasError
must only be accesses while holding the mutex, also increasing the counter must happen under the mutex to ensure without race condition that no transfer is started while the device is not OK.Implementation
bool startTransfer()
as described above.void stopTransfer()
.Definition of done
The text was updated successfully, but these errors were encountered: