示例#1
0
void FiberBase::start()
{
    m_caller = JSFiber::current();

    if (m_caller)
    {
        v8::Local<v8::Object> co = m_caller->wrap();
        v8::Local<v8::Object> o = wrap();

        v8::Local<v8::Array> ks = co->GetOwnPropertyNames();
        int len = ks->Length();

        int i;

        for (i = 0; i < len; i++)
        {
            v8::Local<v8::Value> k = ks->Get(i);
            o->Set(k, co->Get(k));
        }
    }

    g_jobs.put(this);
    Ref();
}
示例#2
0
文件: Fiber.cpp 项目: ror/fibjs
void AsyncEvent::sync()
{
    g_jobs.put(this);
}
示例#3
0
文件: Fiber.cpp 项目: ror/fibjs
void FiberBase::start()
{
    set_caller(JSFiber::current());
    g_jobs.put(this);
    Ref();
}
示例#4
0
void asyncCallBack::callback()
{
    g_jobs.put(this);
}