mirror of
https://github.com/latentPrion/libspinscale.git
synced 2026-06-23 19:48:32 +00:00
Adversarial review on test porting plan
This commit is contained in:
@@ -180,7 +180,9 @@ public:
|
||||
static void registerThread(
|
||||
PostingThreadRole role,
|
||||
DedicatedIoThread &thread);
|
||||
static void unregisterThread(PostingThreadRole role);
|
||||
static void unregisterThread(
|
||||
PostingThreadRole role,
|
||||
DedicatedIoThread &expectedThread);
|
||||
static boost::asio::io_context &ioContext(PostingThreadRole role);
|
||||
static std::thread::id osThreadId(PostingThreadRole role);
|
||||
|
||||
@@ -240,14 +242,28 @@ public:
|
||||
DedicatedIoThread &leg();
|
||||
|
||||
private:
|
||||
void registerAllThreads();
|
||||
void unregisterAllThreads();
|
||||
void installCallerAsPuppeteer();
|
||||
void restorePreviousPuppeteer();
|
||||
|
||||
DedicatedIoThread callerThread;
|
||||
DedicatedIoThread calleeThread;
|
||||
DedicatedIoThread alternateThread;
|
||||
DedicatedIoThread bodyThread;
|
||||
DedicatedIoThread worldThread;
|
||||
DedicatedIoThread legThread;
|
||||
std::shared_ptr<sscl::PuppeteerThread> previousPuppeteerThread;
|
||||
sscl::ThreadId previousPuppeteerThreadId = 0;
|
||||
};
|
||||
|
||||
template <typename Function>
|
||||
auto RunOnThread(DedicatedIoThread &thread, Function &&function)
|
||||
-> std::invoke_result_t<Function &>
|
||||
{
|
||||
return thread.runSync(std::forward<Function>(function));
|
||||
}
|
||||
|
||||
class CrossThreadTrace
|
||||
{
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user