#include "common/Thread.h"
#include "include/compat.h"
#include "common/errno.h"
+#include "rgw_asio_thread.h"
#include "rgw_common.h"
#include "rgw_kmip_client.h"
RGWKMIPManager *rgw_kmip_manager;
int
-RGWKMIPTransceiver::wait(optional_yield y)
+RGWKMIPTransceiver::wait(const DoutPrefixProvider* dpp, optional_yield y)
{
if (done)
return ret;
+
+ // TODO: when given a coroutine yield context, suspend instead of blocking
+ maybe_warn_about_blocking(dpp);
+
std::unique_lock l{lock};
if (!done)
cond.wait(l);
}
int
-RGWKMIPTransceiver::process(optional_yield y)
+RGWKMIPTransceiver::process(const DoutPrefixProvider* dpp, optional_yield y)
{
int r = send();
if (r < 0)
return r;
- return wait(y);
+ return wait(dpp, y);
}
RGWKMIPTransceiver::~RGWKMIPTransceiver()
#pragma once
+class DoutPrefixProvider;
class RGWKMIPManager;
class RGWKMIPTransceiver {
ceph::mutex lock = ceph::make_mutex("rgw_kmip_req::lock");
ceph::condition_variable cond;
- int wait(optional_yield y);
+ int wait(const DoutPrefixProvider* dpp, optional_yield y);
RGWKMIPTransceiver(CephContext * const cct,
kmip_operation operation)
: cct(cct),
~RGWKMIPTransceiver();
int send();
- int process(optional_yield y);
+ int process(const DoutPrefixProvider* dpp, optional_yield y);
};
class RGWKMIPManager {
RGWKMIPTransceiver secret_req(cct, RGWKMIPTransceiver::LOCATE);
secret_req.name = work.data();
- ret = secret_req.process(y);
+ ret = secret_req.process(dpp, y);
if (ret < 0) {
failed = true;
} else if (!secret_req.outlist->string_count) {
if (failed) return ret;
RGWKMIPTransceiver secret_req(cct, RGWKMIPTransceiver::GET);
secret_req.unique_id = work.data();
- ret = secret_req.process(y);
+ ret = secret_req.process(dpp, y);
if (ret < 0) {
failed = true;
} else {