Merge branch 'master' into master

This commit is contained in:
Simon Fels 2018-05-11 20:06:36 +02:00 committed by GitHub
commit 1878b17743
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 3 deletions

View file

@ -24,6 +24,9 @@
namespace anbox {
namespace container {
const std::chrono::milliseconds ManagementApiStub::stop_waiting_timeout{3000};
ManagementApiStub::ManagementApiStub(
const std::shared_ptr<rpc::Channel> &channel)
: channel_(channel) {}
@ -75,7 +78,9 @@ void ManagementApiStub::stop_container() {
channel_->call_method("stop_container", &message, c->response.get(),
google::protobuf::NewCallback(this, &ManagementApiStub::container_stopped, c.get()));
c->wh.wait_for_all();
// If container manager dies before session manager, the session manager
// cannot exit if it waits for all, so just wait for 3 seconds.
c->wh.wait_for_pending(stop_waiting_timeout);
if (c->response->has_error()) throw std::runtime_error(c->response->error());
}

View file

@ -56,6 +56,7 @@ class ManagementApiStub : public DoNotCopyOrMove {
mutable std::mutex mutex_;
std::shared_ptr<rpc::Channel> channel_;
static const std::chrono::milliseconds stop_waiting_timeout;
};
} // namespace container
} // namespace anbox

View file

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define GLM_ENABLE_EXPERIMENTAL
#include "anbox/graphics/emugl/Renderer.h"
#include "anbox/graphics/emugl/DispatchTables.h"
#include "anbox/graphics/emugl/RenderThreadInfo.h"

View file

@ -70,7 +70,7 @@ void QemudMessageProcessor::process_commands() {
void QemudMessageProcessor::send_header(const size_t &size) {
char header[header_size + 1];
std::snprintf(header, header_size + 1, "%04lx", size);
std::snprintf(header, header_size + 1, "%04zx", size);
messenger_->send(header, header_size);
}