<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    On 10/16/16 2:36 AM, Shai Cantor wrote:<br>
    <blockquote
cite="mid:CA+BoLDaesHBFtyks4dvpJ9CP+7cjjoGDEnvO32mjDn7O9LeUXg@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi,
        <div><br>
        </div>
        <div>So I'm using coverage.py API</div>
        <div>
          <pre style="box-sizing:border-box;font-family:consolas,&quot;andale mono wt&quot;,&quot;andale mono&quot;,&quot;lucida console&quot;,&quot;lucida sans typewriter&quot;,&quot;dejavu sans mono&quot;,&quot;bitstream vera sans mono&quot;,&quot;liberation mono&quot;,&quot;nimbus mono l&quot;,monaco,&quot;courier new&quot;,courier,monospace;font-size:12px;margin-top:0px;margin-bottom:0px;padding:12px;line-height:1.5;overflow:auto;color:rgb(64,64,64)"><span class="gmail-kn" style="box-sizing:border-box">import</span> <span class="gmail-nn" style="box-sizing:border-box;color:rgb(85,85,85)">coverage</span>

<span class="gmail-n" style="box-sizing:border-box;color:rgb(51,51,51)">cov</span> <span class="gmail-o" style="box-sizing:border-box;font-weight:bold">=</span> <span class="gmail-n" style="box-sizing:border-box;color:rgb(51,51,51)">coverage</span><span class="gmail-o" style="box-sizing:border-box;font-weight:bold">.</span><span class="gmail-n" style="box-sizing:border-box;color:rgb(51,51,51)">Coverage</span><span class="gmail-p" style="box-sizing:border-box">()</span>
<span class="gmail-n" style="box-sizing:border-box;color:rgb(51,51,51)">cov</span><span class="gmail-o" style="box-sizing:border-box;font-weight:bold">.</span><span class="gmail-n" style="box-sizing:border-box;color:rgb(51,51,51)">start</span><span class="gmail-p" style="box-sizing:border-box">()</span>

<span class="gmail-c1" style="box-sizing:border-box;color:rgb(153,153,136);font-style:italic"># .. call your code ..</span>

<span class="gmail-n" style="box-sizing:border-box;color:rgb(51,51,51)">cov</span><span class="gmail-o" style="box-sizing:border-box;font-weight:bold">.</span><span class="gmail-n" style="box-sizing:border-box;color:rgb(51,51,51)">stop</span><span class="gmail-p" style="box-sizing:border-box">()</span>
<span class="gmail-n" style="box-sizing:border-box;color:rgb(51,51,51)">cov</span><span class="gmail-o" style="box-sizing:border-box;font-weight:bold">.</span><span class="gmail-n" style="box-sizing:border-box;color:rgb(51,51,51)">save</span><span class="gmail-p" style="box-sizing:border-box">()</span></pre>
        </div>
        <div><br>
        </div>
        <div>The main thread creates a coverage instance and starts it.</div>
        <div>During the lifetime of the program I have multiple threads
          and I need every once in while to reset or restart the
          coverage process (or clear coverage data) from one of the
          underlying threads.</div>
        <div>Problem is that tracing is stopped after I do that. I guess
          it's because I start it from another thread.</div>
        <div><br>
        </div>
        <div>Is there a way I can reset/restart coverage from another
          thread or manually clear coverage data?</div>
        <br>
      </div>
    </blockquote>
    I haven't heard this need before, to occasionally reset or clear the
    coverage data from one of many threads. Can you say more about what
    the bigger picture is here? There might be an easier way to get it
    done.<br>
    <br>
    --Ned.<br>
  </body>
</html>