Check if the head message box should be timed out, returning true if we timed it out static*/
| 150 | |
| 151 | // Check if the head message box should be timed out, returning true if we timed it out |
| 152 | /*static*/ bool MessageBox::CheckTimeout() noexcept |
| 153 | { |
| 154 | if (mboxList != nullptr) |
| 155 | { |
| 156 | WriteLocker locker(mboxLock); |
| 157 | |
| 158 | MessageBox *mb = mboxList; |
| 159 | if (mb != nullptr && mb->timeout != 0 && millis() - startTime >= mb->timeout) |
| 160 | { |
| 161 | mboxList = mb->next; |
| 162 | mb->TimeOut(); |
| 163 | startTime = millis(); // restart the timeout for the next message box (if any) in the list |
| 164 | return true; |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | return false; |
| 169 | } |
| 170 | |
| 171 | // Time out and delete this message box |
| 172 | void MessageBox::TimeOut() noexcept |