Skip to content

Commit b13da72

Browse files
Removed declaration of the AdHocJob from the ABI headers
1 parent 411cdb7 commit b13da72

File tree

2 files changed

+26
-29
lines changed

2 files changed

+26
-29
lines changed

include/swift/ABI/Task.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -186,27 +186,6 @@ class NullaryContinuationJob : public Job {
186186
}
187187
};
188188

189-
/// Job that allows to use executor API to schedule a block of task-less
190-
/// synchronous code.
191-
class AdHocJob : public Job {
192-
193-
private:
194-
void *Context;
195-
AdHocWorkFunction *Work;
196-
197-
public:
198-
AdHocJob(JobPriority priority, void *context, AdHocWorkFunction *work)
199-
: Job({JobKind::AdHoc, priority}, &process), Context(context),
200-
Work(work) {}
201-
202-
SWIFT_CC(swiftasync)
203-
static void process(Job *job);
204-
205-
static bool classof(const Job *job) {
206-
return job->Flags.getKind() == JobKind::AdHoc;
207-
}
208-
};
209-
210189
/// Describes type information and offers value methods for an arbitrary concrete
211190
/// type in a way that's compatible with regular Swift and embedded Swift. In
212191
/// regular Swift, just holds a Metadata pointer and dispatches to the value

stdlib/public/Concurrency/Task.cpp

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -206,14 +206,6 @@ void NullaryContinuationJob::process(Job *_job) {
206206
swift_continuation_resume(continuation);
207207
}
208208

209-
void AdHocJob::process(Job *_job) {
210-
auto *job = cast<AdHocJob>(_job);
211-
void *ctx = job->Context;
212-
AdHocWorkFunction *work = job->Work;
213-
delete job;
214-
return work(ctx);
215-
}
216-
217209
void AsyncTask::completeFuture(AsyncContext *context) {
218210
using Status = FutureFragment::Status;
219211
using WaitQueueItem = FutureFragment::WaitQueueItem;
@@ -1682,6 +1674,32 @@ swift_task_createNullaryContinuationJobImpl(
16821674
return job;
16831675
}
16841676

1677+
/// Job that allows to use executor API to schedule a block of task-less
1678+
/// synchronous code.
1679+
class AdHocJob : public Job {
1680+
private:
1681+
void *Context;
1682+
AdHocWorkFunction *Work;
1683+
1684+
public:
1685+
AdHocJob(JobPriority priority, void *context, AdHocWorkFunction *work)
1686+
: Job({JobKind::AdHoc, priority}, &process), Context(context),
1687+
Work(work) {}
1688+
1689+
SWIFT_CC(swiftasync)
1690+
static void process(Job *_job) {
1691+
auto *job = cast<AdHocJob>(_job);
1692+
void *ctx = job->Context;
1693+
AdHocWorkFunction *work = job->Work;
1694+
delete job;
1695+
return work(ctx);
1696+
}
1697+
1698+
static bool classof(const Job *job) {
1699+
return job->Flags.getKind() == JobKind::AdHoc;
1700+
}
1701+
};
1702+
16851703
SWIFT_CC(swift)
16861704
static void swift_task_performOnExecutorImpl(void *context,
16871705
AdHocWorkFunction *work,

0 commit comments

Comments
 (0)