Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Schuetz2013-04-30 12:21:39 +0000
committerThomas Schuetz2013-04-30 12:21:39 +0000
commit3f26e81bc9be937a2f6c0bf765628093e6eda05b (patch)
treeeaff9059543706bdfc8b08aaf18b0c6562f0eb70 /runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageQueue.c
parent557eaf3819ee03755134775d16ce1a2951e74222 (diff)
downloadorg.eclipse.etrice-3f26e81bc9be937a2f6c0bf765628093e6eda05b.tar.gz
org.eclipse.etrice-3f26e81bc9be937a2f6c0bf765628093e6eda05b.tar.xz
org.eclipse.etrice-3f26e81bc9be937a2f6c0bf765628093e6eda05b.zip
[runtime.c.tests] fixed testcase for etMessageService
https://bugs.eclipse.org/bugs/show_bug.cgi?id=406888 Change-Id: Ifd556ddb0290477e1588672fa6062433ca887448
Diffstat (limited to 'runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageQueue.c')
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageQueue.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageQueue.c b/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageQueue.c
index b1a5fea54..8c87c853f 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageQueue.c
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageQueue.c
@@ -19,6 +19,7 @@ void etMessageQueue_init(etMessageQueue* self){
self->first = NULL;
self->last = NULL;
self->highWaterMark = 0;
+ self->lowWaterMark = 0;
self->size = 0;
ET_MSC_LOGGER_SYNC_EXIT
}
@@ -64,6 +65,9 @@ etMessage* etMessageQueue_pop(etMessageQueue* self){
pop_msg->next=NULL;
self->size--;
+ if (self->size < self->lowWaterMark)
+ self->lowWaterMark--;
+
ET_MSC_LOGGER_SYNC_EXIT
return pop_msg;
}
@@ -93,7 +97,19 @@ etBool etMessageQueue_isNotEmpty(etMessageQueue* self){
}
etInt16 etMessageQueue_getHighWaterMark(etMessageQueue* self) {
- ET_MSC_LOGGER_SYNC_ENTRY("etMessageQueue", "getHightWaterMark")
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessageQueue", "getHighWaterMark")
ET_MSC_LOGGER_SYNC_EXIT
return self->highWaterMark;
}
+
+etInt16 etMessageQueue_getLowWaterMark(etMessageQueue* self) {
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessageQueue", "getLowWaterMark")
+ ET_MSC_LOGGER_SYNC_EXIT
+ return self->lowWaterMark;
+}
+
+void etMessageQueue_resetLowWaterMark(etMessageQueue* self) {
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessageQueue", "resetLowWaterMark")
+ self->lowWaterMark = self->size;
+ ET_MSC_LOGGER_SYNC_EXIT
+}

Back to the top