title: Simple Mac ProgressIndicator causes crash: "caught causing excessive wakeups"
body: <p>I have this Button click handler (MonoMac on OS X 10.9.3):</p>
  
  <pre><code>partial void OnDoButtonClick(NSObject sender)
  {
      DoButton.Enabled = false;
  
      // Start animation
      ProgressIndicator.StartAnimation(this);
  
      ThreadPool.QueueUserWorkItem(_ =&gt; {
  
          // Perform a task that last for about a second:
          Thread.Sleep(1 * 1000);
  
          // Stop animation:
          InvokeOnMainThread(() =&gt; {
              ProgressIndicator.StopAnimation(this);
              DoButton.Enabled = true;
          });
      });
  }
  </code></pre>
  
  <p>However, when i run the code by pressing the button, the main thread stops the following error occurs:</p>
  
  <blockquote>
    <p>(lldb) quit* thread #1: tid = 0x2bf20, 0x98fd9f7a libsystem_kernel.dylib`mach_msg_trap + 10, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP</p>
  </blockquote>
  
  <p>And, the following log is recorded in the system log:</p>
  
  <pre><code>2014/05/21 13:10:51.752 com.apple.debugserver-310.2[3553]: 1 +0.000001 sec [0de1/1503]: error: ::read ( 0, 0x107557a40, 1024 ) =&gt; -1 err = Connection reset by peer (0x00000036)
  2014/05/21 13:10:51.752 com.apple.debugserver-310.2[3553]: 2 +0.000001 sec [0de1/0303]: error: ::ptrace (request = PT_THUPDATE, pid = 0x0ddc, tid = 0x1a03, signal = -1) err = Invalid argument (0x00000016)
  2014/05/21 13:10:51.753 com.apple.debugserver-310.2[3553]: Exiting.
  2014/05/21 13:11:05.000 kernel[0]: process &lt;AppName&gt;[3548] caught causing excessive wakeups. Observed wakeups rate (per sec): 1513; Maximum permitted wakeups rate (per sec): 150; Observation period: 300 seconds; Task lifetime number of wakeups: 45061
  2014/05/21 13:11:05.302 ReportCrash[3555]: Invoking spindump for pid=3548 wakeups_rate=1513 duration=30 because of excessive wakeups
  2014/05/21 13:11:07.452 spindump[3556]: Saved wakeups_resource.spin report for &lt;AppName&gt; version 1.2.1.0 (1) to /Library/Logs/DiagnosticReports/&lt;AppName&gt;_2014-05-21-131107_&lt;UserName&gt;-MacBook-Pro.wakeups_resource.spin
  </code></pre>
  
  <p>Extract from above: <code>Maximum permitted wakeups rate (per sec): 150; Observation period: 300 seconds; Task lifetime number of wakeups: 45061</code></p>
  
  <p>The problem does NOT happen if I remove the <code>ProgressIndicator.StartAnimation(this);</code> and <code>ProgressIndicator.StopAnimation(this);</code> lines.</p>
  
  <p>Why is the main thread stopped by SIGSTOP?</p>