Signed-off-by: Christian Muck <christian.muck@bmw.de>
/* Message was not sent to client, so store it in client ringbuffer */
if (sent==0)
{
+ DLT_DAEMON_SEM_LOCK();
if (dlt_buffer_push3(&(daemon->client_ringbuffer),
daemon_local->msg.headerbuffer+sizeof(DltStorageHeader),daemon_local->msg.headersize-sizeof(DltStorageHeader),
daemon_local->msg.databuffer,daemon_local->msg.datasize,
{
dlt_log(LOG_ERR,"Storage of message in history buffer failed! Message discarded.\n");
}
+ DLT_DAEMON_SEM_FREE();
}
}
}
else
{
+ DLT_DAEMON_SEM_LOCK();
/* Store message in history buffer */
if (dlt_buffer_push3(&(daemon->client_ringbuffer),
msg->headerbuffer+sizeof(DltStorageHeader),msg->headersize-sizeof(DltStorageHeader),
0, 0
)<0)
{
+ DLT_DAEMON_SEM_FREE();
dlt_log(LOG_ERR,"Storage of message in history buffer failed! Message discarded.\n");
return;
}
+ DLT_DAEMON_SEM_FREE();
}
}