<table><tr><td style="">rkflx updated this revision to Diff 18960.<br />rkflx edited the summary of this revision. <a href="https://phabricator.kde.org/transactions/detail/PHID-XACT-DREV-o76nkxncldvr4qe/" rel="noreferrer">(Show Details)</a><br />rkflx added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D7595" rel="noreferrer">View Revision</a></tr></table><br /><div><div><p>Thanks Oliver, I like compromises. You inspired me to try another way: Out with the <tt style="background: #ebebeb; font-size: 13px;">unique_lock<mutex></tt>, in with the <tt style="background: #ebebeb; font-size: 13px;">unique_ptr<bool></tt>. This way no custom RAII wrapper is needed.</p>

<p>OTOH, I'm not really convinced there is no threading involved (or will be in the future). Anyway, I hope this is acceptable now.</p></div></div><br /><div><strong>CHANGES TO REVISION SUMMARY</strong><div><div style="white-space: pre-wrap; color: #74777D;"><div style="padding: 8px 0;">...</div>any time. Any further reload requests are discarded.<br />
<br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">Implementation:<br />
- use std::unique_lock, as QMutexLocker lacks support for try_lock<br />
- use std::mutex, as QMutex supports try_lock only since Qt 5.8<br />
<br />
</span>Note: The "Reload" menu entry and shortcut are already disabled while<div style="padding: 8px 0;">...</div>Thanks to @aacid for finding the fix, this merely improves the<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);"><br />
implementation by using a mutex with RAII instead of a non-atomic and</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">implementation by using RAII instead of a </span>non-dry bool<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">ean</span>.</div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R223 Okular</div></div></div><br /><div><strong>CHANGES SINCE LAST UPDATE</strong><div><a href="https://phabricator.kde.org/D7595?vs=18903&id=18960" rel="noreferrer">https://phabricator.kde.org/D7595?vs=18903&id=18960</a></div></div><br /><div><strong>BRANCH</strong><div><div>reload-mutex (branched from Applications/17.08)</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D7595" rel="noreferrer">https://phabricator.kde.org/D7595</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>part.cpp<br />
part.h</div></div></div><br /><div><strong>To: </strong>rkflx, Okular<br /><strong>Cc: </strong>sander, aacid<br /></div>