<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/122915/">https://git.reviewboard.kde.org/r/122915/</a>
     </td>
    </tr>
   </table>
   <br />










<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On March 12th, 2015, 1:12 p.m. UTC, <b>Aleix Pol Gonzalez</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  


<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="https://git.reviewboard.kde.org/r/122915/diff/1/?file=354535#file354535line421" style="color: black; font-weight: bold; text-decoration: underline;">src/plasma/theme.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 1)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">void Theme::insertIntoRectsCache(const QString &image, const QString &element, const QRectF &rect)</pre></td>

  </tr>
 </tbody>



 
 

 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">420</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="n">d</span><span class="o">-></span><span class="n">rectSaveTimer</span><span class="o">-></span><span class="n">start</span><span class="p">();</span></pre></td>
    <th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">421</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="k">if</span> <span class="p">(</span><span class="n">Q_UNLIKELY</span><span class="p">(</span><span class="kr">thread</span><span class="p">()</span> <span class="o">!=</span> <span class="n">QThread</span><span class="o">::</span><span class="n">currentThread</span><span class="p">()))</span> <span class="p">{</span></pre></td>
  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">If that's the case, then we will need locking, no?</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">We don't want 2 different threads modifying the class members at the same time...</p></pre>
 </blockquote>



 <p>On March 12th, 2015, 1:24 p.m. UTC, <b>Marco Martin</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">seems things gets called from a different thread once right after being created..
that would make it the case for every single class created from QML i guess?
needs more investigation, but this can potentially unveil a deeper problem in QML?</p></pre>
 </blockquote>





 <p>On March 12th, 2015, 1:26 p.m. UTC, <b>Aleix Pol Gonzalez</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Can you maybe provide a backtrace of the Q_UNLIKELY path? It can be interesting to understand what's going on.</p></pre>
 </blockquote>







</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">This, seems to happen always only once in the lifecycle of a SvgItem:</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">0       Plasma::Theme::insertIntoRectsCache     theme.cpp       422     0x7f0794bf21fd<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
1       Plasma::SvgPrivate::findAndCacheElementRect     svg.cpp 551     0x7f0794be8bb4<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
2       Plasma::SvgPrivate::elementRect svg.cpp 525     0x7f0794be8778<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
3       Plasma::Svg::hasElement svg.cpp 865     0x7f0794bea652<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
4       Plasma::SvgPrivate::findInCache svg.cpp 335     0x7f0794be7329<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
5       Plasma::Svg::image      svg.cpp 771     0x7f0794be9cb1<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
6       Plasma::SvgItem::updatePaintNode        svgitem.cpp     161     0x7f077c080a86<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
7       QQuickWindowPrivate::updateDirtyNode    qquickwindow.cpp        2823    0x7f0795333811<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
8       QQuickWindowPrivate::updateDirtyNodes   qquickwindow.cpp        2648    0x7f079533285f<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
9       QQuickWindowPrivate::syncSceneGraph     qquickwindow.cpp        340     0x7f0795327d4c<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
10      QSGRenderThread::sync   qsgthreadedrenderloop.cpp       510     0x7f07952f15da<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
11      QSGRenderThread::syncAndRender  qsgthreadedrenderloop.cpp       553     0x7f07952f1abf<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
12      QSGRenderThread::run    qsgthreadedrenderloop.cpp       663     0x7f07952f2734<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
13      QThreadPrivate::start   qthread_unix.cpp        337     0x7f07905321bf<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
14      start_thread    /lib64/libpthread.so.0          0x7f078f6800db<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
15      clone   /lib64/libc.so.6                0x7f078f97f90d</p></pre>
<br />




<p>- Marco</p>


<br />
<p>On March 12th, 2015, 1:25 p.m. UTC, Marco Martin wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: 1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
 <tr>
  <td>

<div>Review request for Plasma.</div>
<div>By Marco Martin.</div>


<p style="color: grey;"><i>Updated March 12, 2015, 1:25 p.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
plasma-framework
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">rectSaveTimer is used to event compress the save and sync of the configuration file that is used as a cache of the rectangles of svg items (in order to avoid svg renderers creation when possible)
there is exactly one situation where it seems to not work: during creation of svgitems/framesvgitems, insertintorectcache ends up being called by another thread than the Theme's qobject thread, and that is not allowed. so in this case </p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">during normal svg resizes, all goes as before</p></pre>
  </td>
 </tr>
</table>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>src/plasma/theme.cpp <span style="color: grey">(18d4ed6)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/122915/diff/" style="margin-left: 3em;">View Diff</a></p>






  </td>
 </tr>
</table>







  </div>
 </body>
</html>