Async: add sh_ptr<ContinuationChainLink> to Callback<>

This change enables us to finally implement the tracing of
continuations backward from the point of acquisition for deadlock
debugging.
This commit is contained in:
2025-09-27 18:30:09 -04:00
parent 2212aec080
commit 782bcd4567
26 changed files with 384 additions and 269 deletions
+6 -5
View File
@@ -8,6 +8,7 @@
#include <xcb/xcb.h>
#include <user/senseApiDesc.h>
#include <user/deviceAttachmentSpec.h>
#include <callback.h>
#include <xcbXorg/xcbXorg.h>
#include "xcbWindow.h"
@@ -276,7 +277,7 @@ static int xcbWindow_finalizeInd(void)
static void xcbWindow_attachDeviceReq(
const std::shared_ptr<smo::device::DeviceAttachmentSpec>& desc,
const std::shared_ptr<smo::ComponentThread>& componentThread,
smo::sense_api::sal_mlo_attachDeviceReqCbFn cb
smo::Callback<smo::sense_api::sal_mlo_attachDeviceReqCbFn> cb
)
{
// Not used yet, but may be used later.
@@ -289,12 +290,12 @@ static void xcbWindow_attachDeviceReq(
<< g_attachedWindows.back()->stringify()
<< "\n";
cb(true, desc);
cb.callbackFn(true, desc);
}
static void xcbWindow_detachDeviceReq(
const std::shared_ptr<smo::device::DeviceAttachmentSpec>& spec,
smo::sense_api::sal_mlo_detachDeviceReqCbFn cb
smo::Callback<smo::sense_api::sal_mlo_detachDeviceReqCbFn> cb
)
{
auto it = std::find_if(g_attachedWindows.begin(), g_attachedWindows.end(),
@@ -308,7 +309,7 @@ static void xcbWindow_detachDeviceReq(
std::cerr << __func__ << ": Device not found for detachment:\n"
<< spec->stringify() << "\n";
cb(false, spec);
cb.callbackFn(false, spec);
return;
}
@@ -316,7 +317,7 @@ static void xcbWindow_detachDeviceReq(
std::cout << __func__ << ": Detached X11 window device:\n"
<< spec->stringify() << "\n";
cb(true, spec);
cb.callbackFn(true, spec);
}
// SenseApi descriptor