[Webkit-unassigned] [Bug 74535] [chromium] Add postCancellable[Delayed]Task to CCThread

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Dec 14 13:34:56 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=74535





--- Comment #2 from Tien-Ren Chen <trchen at chromium.org>  2011-12-14 13:34:56 PST ---
    The postCancellable[Delayed]Task functions will return CCTaskHandle for the
    newly appended tasks. Where CCTaskHandle is non-copyable but transferable
    weak pointer to the task, such that the task will be automatically cancelled
    upon destruction of the handle.

    This allows objects which has shorter lifespan than the thread to safely post
    tasks, so the task would be "scoped" in the sense that the task will be
    cancelled once the owner got destroyed.

    HOW TO USE:

    class SomeClass {
    private:
        CCTaskHandle m_task;
    };

    SomeClass::scheduleSomething() {
        m_task = CCProxy::implThread()->postCancellableDelayedTask(
            createCCThreadTask(this, &SomeClass::method, arg),
            s_timeout);
    }

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list