Made several functions threadsafe (cont'd)

This commit is contained in:
Klaus Schmidinger
2004-12-26 12:45:22 +01:00
parent f97b1069c6
commit 286af66cfb
26 changed files with 295 additions and 322 deletions

39
HISTORY
View File

@@ -3160,7 +3160,7 @@ Video Disk Recorder Revision History
right day of week for timers in the future.
- Some improvements to cPoller (thanks to Marco Schl<68><6C>ler).
2004-12-24: Version 1.3.18
2004-12-26: Version 1.3.18
- Removed an unused variable from cTimer::GetWDayFromMDay() (thanks to Wayne Keer
for reporting this one).
@@ -3215,12 +3215,37 @@ Video Disk Recorder Revision History
the actual buffering. In particular these are:
readdir() -> cReadDir
readline() -> cReadLine
strescape() -> cStrEscape
AddDirectory() -> cAddDirectory
ctime() -> cCtime
itoa() -> cItoa
WeekDayName() -> cWeekDayName
DayDateTime() -> cDayDateTime
- Several formerly non-threadsafe functions now have a return type of cString:
cChannel::ToText()
tChannelID::ToString()
cEvent::GetDateString()
cEvent::GetTimeString()
cEvent::GetEndTimeString()
cEvent::GetVpsString()
cMark::ToText()
cTimer::ToText()
cSource::ToString()
cTimer::PrintDay()
cTimer::PrintFirstDay()
PrefixVideoFileName()
IndexToHMSF()
ChannelString()
strescape()
AddDirectory()
itoa()
WeekDayName()
DayDateTime()
When using these functions in a 'const char *' context there is nothing special
to consider, except that you can no longer have a pointer to the return value,
as in
const char *date = DayDateTime();
Although this will compile without error message, the resulting 'date' will not
be valid after this line. Use this instead:
cString date = DayDateTime();
In a 'const void *' context (as in printf() etc.) the result needs to be
dereferenced with a '*', as in
printf("%s", *DayDateTime());
to make it a 'const char *'.
- Removed delay_ms(), using cCondWait::SleepMs() instead.
- Replaced time_ms() with a threadsafe and non-overflowing cTimeMs (thanks to Rainer
Zocholl for pointing out this problem).