'Test callFromThread functionality: from the main thread, and from
another thread.'

def test_callFromThread(self):

    def cb(ign):
        firedByReactorThread = defer.Deferred()
        firedByOtherThread = defer.Deferred()
        def threadedFunc():
            reactor.callFromThread(firedByOtherThread.callback, None)
        reactor.callInThread(threadedFunc)
        reactor.callFromThread(firedByReactorThread.callback, None)
        return defer.DeferredList([firedByReactorThread, firedByOtherThread], fireOnOneErrback=True)
    return self._waitForThread().addCallback(cb)
