<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>Sixeight</author_name>
  <author_url>https://blog.hatena.ne.jp/Sixeight/</author_url>
  <blog_title>ちなみに</blog_title>
  <blog_url>https://blog.nishimu.land/</blog_url>
  <categories>
    <anon>ruby</anon>
  </categories>
  <description>たとえば、ループするような処理を走らせているスレッドを、メインスレッドから一時的に停止させたのち、もう一度処理を続行させたいときは、以下のように外部のフラグによって停止させると良い。（というか今の僕にはこれしか思いつかなかった。Queueとか使う手もありかと） まずはスレッドを作ります @stop = false th = Thread.new do loop do # some task here Thread.stop if @stop end end p Thread.list #=&gt; [#&lt;Thread:0xb7cc6a5c run&gt;, #&lt;Thread:0xb7cd41ac run&gt;…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.nishimu.land%2Fentry%2F20081204%2F1228380528&quot; title=&quot;あるスレッドを別のスレッドから制御する - ちなみに&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2008-12-04 17:48:48</published>
  <title>あるスレッドを別のスレッドから制御する</title>
  <type>rich</type>
  <url>https://blog.nishimu.land/entry/20081204/1228380528</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
