mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Concurrency] adjust how we fail creating an IsIsolatingCurrentContextDecision
This commit is contained in:
@@ -17,8 +17,6 @@
|
|||||||
#ifndef SWIFT_ABI_EXECUTOR_H
|
#ifndef SWIFT_ABI_EXECUTOR_H
|
||||||
#define SWIFT_ABI_EXECUTOR_H
|
#define SWIFT_ABI_EXECUTOR_H
|
||||||
|
|
||||||
#include "../../../stdlib/public/Concurrency/Error.h"
|
|
||||||
|
|
||||||
#include "swift/ABI/Actor.h"
|
#include "swift/ABI/Actor.h"
|
||||||
#include "swift/ABI/HeapObject.h"
|
#include "swift/ABI/HeapObject.h"
|
||||||
#include "swift/Runtime/Casting.h"
|
#include "swift/Runtime/Casting.h"
|
||||||
@@ -427,27 +425,10 @@ enum class IsIsolatingCurrentContextDecision : int8_t {
|
|||||||
Isolated,
|
Isolated,
|
||||||
};
|
};
|
||||||
|
|
||||||
inline IsIsolatingCurrentContextDecision
|
IsIsolatingCurrentContextDecision
|
||||||
getIsIsolatingCurrentContextDecisionFromInt(int8_t value) {
|
getIsIsolatingCurrentContextDecisionFromInt(int8_t value);
|
||||||
switch (value) {
|
|
||||||
case -1: return IsIsolatingCurrentContextDecision::Unknown;
|
|
||||||
case 0: return IsIsolatingCurrentContextDecision::NotIsolated;
|
|
||||||
case 1: return IsIsolatingCurrentContextDecision::Isolated;
|
|
||||||
default:
|
|
||||||
swift_Concurrency_fatalError(0, "Unexpected IsIsolatingCurrentContextDecision value");
|
|
||||||
return IsIsolatingCurrentContextDecision::Unknown; // silence warning about missing return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
inline StringRef getIsIsolatingCurrentContextDecisionNameStr(IsIsolatingCurrentContextDecision decision) {
|
StringRef getIsIsolatingCurrentContextDecisionNameStr(IsIsolatingCurrentContextDecision decision);
|
||||||
switch (decision) {
|
|
||||||
case IsIsolatingCurrentContextDecision::Unknown: return "Unknown";
|
|
||||||
case IsIsolatingCurrentContextDecision::NotIsolated: return "NotIsolated";
|
|
||||||
case IsIsolatingCurrentContextDecision::Isolated: return "Isolated";
|
|
||||||
}
|
|
||||||
swift_Concurrency_fatalError(0, "Unexpected IsIsolatingCurrentContextDecision value");
|
|
||||||
return "<Unexpected Value>"; // silence warning about missing return
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -160,6 +160,28 @@ extern "C" void swift_job_dealloc(SwiftJob *job, void *ptr) {
|
|||||||
return _swift_task_dealloc_specific(task, ptr);
|
return _swift_task_dealloc_specific(task, ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IsIsolatingCurrentContextDecision
|
||||||
|
swift::getIsIsolatingCurrentContextDecisionFromInt(int8_t value) {
|
||||||
|
switch (value) {
|
||||||
|
case -1: return IsIsolatingCurrentContextDecision::Unknown;
|
||||||
|
case 0: return IsIsolatingCurrentContextDecision::NotIsolated;
|
||||||
|
case 1: return IsIsolatingCurrentContextDecision::Isolated;
|
||||||
|
default:
|
||||||
|
swift_Concurrency_fatalError(0, "Unexpected IsIsolatingCurrentContextDecision value");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
StringRef
|
||||||
|
swift::getIsIsolatingCurrentContextDecisionNameStr(IsIsolatingCurrentContextDecision decision) {
|
||||||
|
switch (decision) {
|
||||||
|
case IsIsolatingCurrentContextDecision::Unknown: return "Unknown";
|
||||||
|
case IsIsolatingCurrentContextDecision::NotIsolated: return "NotIsolated";
|
||||||
|
case IsIsolatingCurrentContextDecision::Isolated: return "Isolated";
|
||||||
|
}
|
||||||
|
swift_Concurrency_fatalError(0, "Unexpected IsIsolatingCurrentContextDecision value");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/****************************** MAIN EXECUTOR *******************************/
|
/****************************** MAIN EXECUTOR *******************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|||||||
Reference in New Issue
Block a user