コード例 #1
0
ファイル: transport.cpp プロジェクト: xandr84/RPC
Variant ClientBase::call(ObjectID id, const string &name, const Variant &args, 
	bool withResult, float timeout, FutureResultPtr &written)
{
	if(asyncMode())
		return asyncCall(id, name, args, withResult, timeout, written);
	return syncCall(id, name, args, withResult);
}
コード例 #2
0
ファイル: Runtime.cpp プロジェクト: asionius/fibjs
void Isolate::Unref(int32_t hr)
{
    if (s_iso_ref.dec() == 0) {
        Isolate* isolate = s_isolates.head();
        isolate->m_hr = hr;
        syncCall(isolate, syncExit, isolate);
    }
}
コード例 #3
0
ファイル: mysql.cpp プロジェクト: AirBayCreative/fibjs
mysql::~mysql()
{
    if (m_conn)
    {
        syncCall(close_conn, m_conn);
        m_conn = NULL;
    }
}
コード例 #4
0
ファイル: MongoCursor.cpp プロジェクト: ror/fibjs
MongoCursor::~MongoCursor()
{
    m_query.Reset();
    if (in_gc())
        syncCall(close_cursor, m_cursor);
    else
    {
        mongo_cursor_destroy(m_cursor);
        delete m_cursor;
    }

    if (m_bInit)
        bson_destroy(&m_bbq);
    bson_destroy(&m_bbp);
}
コード例 #5
0
ファイル: fibjs.cpp プロジェクト: jim4node/fibjs
void main(int32_t argc, char *argv[])
{
    init(argc, argv);

    int32_t i;

    for (i = 1; (i < argc) && (argv[i][0] == '-'); i ++);

    const char *fname = NULL;
    if (i < argc)
        fname = argv[i];

    Isolate* isolate = new Isolate(fname);
    syncCall(isolate, main_fiber, isolate);
    exlib::Service::dispatch();
}
コード例 #6
0
ファイル: Worker.cpp プロジェクト: lx6317648/fibjs
void Worker::start()
{
    m_event = new Event();
    syncCall(m_isolate, worker_fiber, this);
    m_event->wait();
}
コード例 #7
0
ファイル: Runtime.cpp プロジェクト: asionius/fibjs
 static void start_fiber(void* p)
 {
     MainThread* th = (MainThread*)p;
     Isolate* isolate = new Isolate(th->m_start);
     syncCall(isolate, th->m_main, isolate);
 }
コード例 #8
0
ファイル: Runtime.cpp プロジェクト: asionius/fibjs
void Isolate::RequestInterrupt(v8::InterruptCallback callback, void* data)
{
    m_isolate->RequestInterrupt(callback, data);
    if (m_has_timer.CompareAndSwap(0, 1) == 0)
        syncCall(this, js_timer, this);
}
コード例 #9
0
ファイル: Timer.cpp プロジェクト: icodingforfood/fibjs
	virtual void resume()
	{
		syncCall(holder(), _callback, this);
	}