[pvr.hts] replace with new implementation #399
Conversation
|
@adamsutton I'll need your help on this, I suck at this mutex stuff. |
|
@Jalle19 something like this: typedef bool (*condition_predicate_callback)(void* param);
bool Wait(CMutex &mutex, condition_predicate_callback callback, void* param, uint32_t iTimeout)
{
if (iTimeout == 0)
return Wait(mutex, callback, param); //got to add this one too
if (callback(param))
return true;
bool bReturn(false);
bool bBreak(false);
CTimeout timeout(iTimeout);
uint32_t iMsLeft(0);
while (!bReturn && !bBreak)
{
iMsLeft = timeout.TimeLeft();
if ((bReturn = (callback(param)) == false && (bBreak = iMsLeft == 0) == false)
m_condition.Wait(mutex.m_mutex, iMsLeft);
}
return bReturn;
} |
|
(and add an implementation of condition_predicate_callback that checks your condition) |
|
@opdenkamp seems to work. Will obviously need some history fixing. |
a5d0898
to
becdbaf
Compare
becdbaf
to
6cde7ea
Compare
|
nice, will check asap. platform lib is used by more than just this Sam Stenvall schreef op 3-1-2015 om 12:50:
|
|
@ksooo can you try the latest master? I screwed up last night and forgot a commit. |
|
@Jalle19 #415 is definitely an improvement, but trying to understand whether this could fix the "deadlocks" I'm expiriencing. Can you point me to an actual bug it fixed (an actual call where * 1000 was forgotten in the code before your commit)? @adamsutton can see an actual deadlock in the callstacks I provided or is it just some "looping" due to very short timeouts caused be the bug #415 fixed? |
|
@ksooo without the latest commit (which is a combination of the commit I missed and a |
|
@Jalle19 Thanks for clarifying. Yes, this makes perfect sence. Especially, because behavior of Kodi felt like "deadlocked", but the callstacks I got didn't show me a classical deadlock situation. So, actually the deadlock seems to turn out as waiting "forever". Will try latest master later when I'm back home and report back then. |
|
Okay, I hope it works because otherwise I'm pretty clueless. |
|
@Jalle19 Turned out as a deadlock in tvheadend, was not related to pvr.hts v2. |
|
@ksooo good to know |
@opdenkamp here it is. Haven't yet tested upgrading from a previous version, will push any changes as separate commits if I find anything. I also dropped all the translations since they need to be redone (the numbering needed changing and a bunch of strings related to transcoding are no longer used).
I left the change to
mutex.hin a separate commit so it doesn't get lost in the main one. It is used by ourAsyncStateimplementation.The addon version is bumped to 2.0.0, and I've modified the authors line. I'm not sure whether your name should be first or last, you decide if I need to change that.