timerd: prevent events from being deleted while sending them to neutrino

in neutrino's timer list sometimes appears an entry with random values
after deleting one because thread safety is not guaranteed for timerd's
event list while sending items to neutrino, so let's lock the mutex
earlier and unlock it later

Signed-off-by: Christian Schuett <Gaucho316@hotmail.com>
Signed-off-by: Thilo Graf <dbt@novatux.de>


Origin commit data
------------------
Branch: ni/coolstream
Commit: a96fb7b7f0
Author: Christian Schuett <Gaucho316@hotmail.com>
Date: 2014-02-14 (Fri, 14 Feb 2014)



------------------
This commit was generated by Migit
This commit is contained in:
Christian Schuett
2014-02-14 18:40:22 +01:00
committed by Jacek Jendrzej
parent 7dc314700c
commit 25290a0317
3 changed files with 21 additions and 2 deletions

View File

@@ -237,6 +237,8 @@ public:
bool removeEvent(int eventID);
bool stopEvent(int eventID);
CTimerEvent* getNextEvent();
int lockEvents();
int unlockEvents();
bool listEvents(CTimerEventMap &Events);
CTimerd::CTimerEventTypes *getEventType(int eventID);
// int modifyEvent(int eventID, time_t announceTime, time_t alarmTime, time_t stopTime, uint32_t repeatcount, CTimerd::CTimerEventRepeat evrepeat = CTimerd::TIMERREPEAT_ONCE);