Skip to content

Commit

Permalink
Use a separate executor/thread for ClientSync
Browse files Browse the repository at this point in the history
Summary: Sometimes ClientSync never gets created because the relevant task, which is scheduled on an executor, is never called. We do not know the root cause, but we (Kay, Michael, JP, and I) attempt to minimize the severity of the issue by creating a separate executor/thread for ClientSync on every new TW cast session.

Differential Revision: D51184111

fbshipit-source-id: 7fa7265f928671d95c1791eb111707584fb16efe
  • Loading branch information
kind-serge authored and facebook-github-bot committed Nov 12, 2023
1 parent 08a04f0 commit 0f2b807
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cxx/fbjni/JThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ class JThread : public JavaClass<JThread> {
static const auto method = getClass()->getMethod<void(int)>("setPriority");
method(self(), priority);
}

void setName(const std::string& name) {
static const auto method =
getClass()->getMethod<void(alias_ref<JString>)>("setName");
method(self(), make_jstring(std::move(name)));
}
};

} // namespace jni
Expand Down

0 comments on commit 0f2b807

Please sign in to comment.