UsbDk: Make list enumeration interruptible
Functor may return false to stop enumeration Signed-off-by: Pavel Gurvich <pavel@daynix.com> Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
This commit is contained in:
parent
8539bed118
commit
ce2c4e5ea7
1 changed files with 8 additions and 2 deletions
|
|
@ -128,7 +128,10 @@ public:
|
|||
CLockedContext<TAccessStrategy> LockedContext(*this);
|
||||
while (!IsListEmpty(&m_List))
|
||||
{
|
||||
Functor(Pop_LockLess());
|
||||
if (!Functor(Pop_LockLess()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -160,7 +163,10 @@ private:
|
|||
if (Predicate(Object))
|
||||
{
|
||||
Prepare(CurrEntry);
|
||||
Functor(Object);
|
||||
if (!Functor(Object))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue