Merged
Conversation
`ALooper_pollAll` with a 0 timeout returns immediately.
36b2997 to
c1a39d8
Compare
AWoloszyn
reviewed
Dec 20, 2018
cmd/gapir/cc/main.cpp
Outdated
|
|
||
| namespace { | ||
|
|
||
| #define JNI_CALL_O(obj, name, sig, ...) \ |
Contributor
There was a problem hiding this comment.
I would prefer to see this as a template, rather than a macro.
Pardon my bad pseudo-code and making up names of JNI api things:
template<typename... Args>
jobject jni_call_o(Env* env, clazz obj, const char* name, const char* sig, Args&&... args) {
return env->CallObjectMethod(obj, env->GetMethodIf()......, std::forward<Args>(args)...);
}
AWoloszyn
approved these changes
Dec 20, 2018
Contributor
AWoloszyn
left a comment
There was a problem hiding this comment.
Approved, but I would really prefer to see the Macro turned into a template, since macros make me sad.
c1a39d8 to
6a2fc9f
Compare
Don't drop log messages on exit on the floor.
`session.close` invokes the callback from `getOrCreateSession`, which aquires the mutex. Thus `session.close` has to be called without holding the mutex.
Usually gapir is shutdown, when gapis is shutting down, which means the context is cancelled, and gRPC would ignore it.
`rpcServer->Shutdown` blocks until all RPCs have finished. Calling it from within an RPC, well, deadlocks. Also correctly sets and fixes the usage of the `mShuttingDown` latch.
6a2fc9f to
18d3460
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
gapisandgapirshutdown handling was, well, quite broken. This fixes things. The most noticeable thing this fixes is Androidgapir: it no longer uses a full core while idling and the app will exit when the client exits.gapisfixes:ShutdownRPC togapir.gapirfixes:ALooper_pollAllcall, because 0 causes it to return immediately and the tight loop causes a full core to spin.gapirexits.ShutdownRPC request.