title: CFRunLoopSourceSignal doesn't work
body: <p>I'm debugging Qt5.3.1 on Mac, because my program freezes sometimes (intermittent ). I discovered that it is because the QTimer can't work properly.</p>
  
  <p>In Qt code, they use the following two lines to trigger function activateTimersSourceCallback</p>
  
  <pre><code>CFRunLoopSourceSignal(d-&gt;activateTimersSourceRef);
  CFRunLoopWakeUp(mainRunLoop());
  
  void QCocoaEventDispatcherPrivate::activateTimersSourceCallback(void *info)
  {
      static int counter = 0;
      NSLog(@"finished activeteTimersSourceCallback %d", counter++);
  }
  </code></pre>
  
  <p>but sometimes, these two lines doesn't work, activateTimersSourceCallback won't get called.</p>
  
  <p>I googled, but I couldn't find any solution? is this a known OS bug?</p>
  
  <p>the initialization details:</p>
  
  <pre><code>// keep our sources running when modal loops are running
  CFRunLoopAddCommonMode(mainRunLoop(), (CFStringRef) NSModalPanelRunLoopMode);
  
  CFRunLoopSourceContext context;
  bzero(&amp;context, sizeof(CFRunLoopSourceContext));
  context.info = d;
  context.equal = runLoopSourceEqualCallback;
  
  // source used to activate timers
  context.perform = QCocoaEventDispatcherPrivate::activateTimersSourceCallback;
  d-&gt;activateTimersSourceRef = CFRunLoopSourceCreate(kCFAllocatorDefault, 0, &amp;context);
  Q_ASSERT(d-&gt;activateTimersSourceRef);
  CFRunLoopAddSource(mainRunLoop(), d-&gt;activateTimersSourceRef, kCFRunLoopCommonModes);
  </code></pre>