Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed
Fork of MbedSmartRestMain by
Diff: operation/OperationStore.cpp
- Revision:
- 63:010bbbb4732a
- Parent:
- 62:86a04c5bda18
--- a/operation/OperationStore.cpp Wed Oct 29 21:09:29 2014 +0000 +++ b/operation/OperationStore.cpp Thu Oct 30 11:58:03 2014 +0000 @@ -49,6 +49,25 @@ _mutex.unlock(); return false; } + +bool OperationStore::hasPending() +{ + size_t n; + Operation *tmp; + + _mutex.lock(); + for (n = 0; n < _count; n++) { + tmp = get(n); + if (tmp->state != OPERATION_PENDING) + continue; + + _mutex.unlock(); + return true; + } + + _mutex.unlock(); + return false; +} bool OperationStore::markAsDone(Operation& operation, bool successful) {