Merge branch 'master' into master
This commit is contained in:
commit
1878b17743
4 changed files with 9 additions and 3 deletions
|
|
@ -24,6 +24,9 @@
|
||||||
|
|
||||||
namespace anbox {
|
namespace anbox {
|
||||||
namespace container {
|
namespace container {
|
||||||
|
|
||||||
|
const std::chrono::milliseconds ManagementApiStub::stop_waiting_timeout{3000};
|
||||||
|
|
||||||
ManagementApiStub::ManagementApiStub(
|
ManagementApiStub::ManagementApiStub(
|
||||||
const std::shared_ptr<rpc::Channel> &channel)
|
const std::shared_ptr<rpc::Channel> &channel)
|
||||||
: channel_(channel) {}
|
: channel_(channel) {}
|
||||||
|
|
@ -75,7 +78,9 @@ void ManagementApiStub::stop_container() {
|
||||||
channel_->call_method("stop_container", &message, c->response.get(),
|
channel_->call_method("stop_container", &message, c->response.get(),
|
||||||
google::protobuf::NewCallback(this, &ManagementApiStub::container_stopped, c.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());
|
if (c->response->has_error()) throw std::runtime_error(c->response->error());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ class ManagementApiStub : public DoNotCopyOrMove {
|
||||||
|
|
||||||
mutable std::mutex mutex_;
|
mutable std::mutex mutex_;
|
||||||
std::shared_ptr<rpc::Channel> channel_;
|
std::shared_ptr<rpc::Channel> channel_;
|
||||||
|
static const std::chrono::milliseconds stop_waiting_timeout;
|
||||||
};
|
};
|
||||||
} // namespace container
|
} // namespace container
|
||||||
} // namespace anbox
|
} // namespace anbox
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
#define GLM_ENABLE_EXPERIMENTAL
|
||||||
#include "anbox/graphics/emugl/Renderer.h"
|
#include "anbox/graphics/emugl/Renderer.h"
|
||||||
#include "anbox/graphics/emugl/DispatchTables.h"
|
#include "anbox/graphics/emugl/DispatchTables.h"
|
||||||
#include "anbox/graphics/emugl/RenderThreadInfo.h"
|
#include "anbox/graphics/emugl/RenderThreadInfo.h"
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ void QemudMessageProcessor::process_commands() {
|
||||||
|
|
||||||
void QemudMessageProcessor::send_header(const size_t &size) {
|
void QemudMessageProcessor::send_header(const size_t &size) {
|
||||||
char header[header_size + 1];
|
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);
|
messenger_->send(header, header_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue