Skip to content

Commit

Permalink
core, refactor: set native async function name.
Browse files Browse the repository at this point in the history
  • Loading branch information
xicilion committed Sep 5, 2022
1 parent 427a346 commit fe8fe2c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
5 changes: 4 additions & 1 deletion fibjs/src/base/function.cpp
Expand Up @@ -107,7 +107,10 @@ v8::Local<v8::Value> JSFunction::Call(v8::Local<v8::Context> context, v8::Local<
}
}

ev->wait();
{
METHOD_NAME("promise.call");
ev->wait();
}

JSValue error = _data->Get(context, isolate->NewString("_error"));
if (!error.IsEmpty() && !error->IsUndefined() && !error->IsNull())
Expand Down
5 changes: 4 additions & 1 deletion fibjs/src/coroutine/coroutine.cpp
Expand Up @@ -84,7 +84,10 @@ class _parallels {
for (i = 0; i < m_fibers; i++)
syncCall(m_isolate, worker, this);

m_event->wait();
{
METHOD_NAME("coroutine.parallel");
m_event->wait();
}

m_datas.Reset();
m_func.Reset();
Expand Down
6 changes: 5 additions & 1 deletion fibjs/src/util/LruCache.cpp
Expand Up @@ -135,7 +135,11 @@ result_t LruCache::get(exlib::string name, v8::Local<v8::Function> updater,
}

e = padding->second;
e->wait();

{
METHOD_NAME("LruCache.get");
e->wait();
}
}

update(find);
Expand Down
5 changes: 4 additions & 1 deletion fibjs/src/util/util_sync.cpp
Expand Up @@ -63,7 +63,10 @@ static void sync_stub(const v8::FunctionCallbackInfo<v8::Value>& args)
if (result.IsEmpty())
return;

ev->wait();
{
METHOD_NAME("util.sync");
ev->wait();
}

JSValue error = _data->Get(context, isolate->NewString("_error"));

Expand Down

0 comments on commit fe8fe2c

Please sign in to comment.