Skip to content

Commit 0164963

Browse files
committed
Concurrency: Remove currently-unused non-_f variants of swift_task_create
I'm about to replace these with new variations that correctly handle spawning a task with a closure as its initial entry point, without leaking or requiring large amounts of caller-side code generation.
1 parent 511f9aa commit 0164963

File tree

3 files changed

+1
-50
lines changed

3 files changed

+1
-50
lines changed

include/swift/Runtime/Concurrency.h

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,6 @@ struct AsyncTaskAndContext {
3030
AsyncContext *InitialContext;
3131
};
3232

33-
/// Create a task object with no future which will run the given
34-
/// function.
35-
///
36-
/// The task is not yet scheduled.
37-
///
38-
/// If a parent task is provided, flags.task_hasChildFragment() must
39-
/// be true, and this must be called synchronously with the parent.
40-
/// The parent is responsible for creating a ChildTaskStatusRecord.
41-
/// TODO: should we have a single runtime function for creating a task
42-
/// and doing this child task status record management?
43-
SWIFT_EXPORT_FROM(swift_Concurrency) SWIFT_CC(swift)
44-
AsyncTaskAndContext swift_task_create(JobFlags flags,
45-
AsyncTask *parent,
46-
const ThinNullaryAsyncSignature::FunctionPointer *function);
47-
4833
/// Create a task object with no future which will run the given
4934
/// function.
5035
SWIFT_EXPORT_FROM(swift_Concurrency) SWIFT_CC(swift)
@@ -58,24 +43,6 @@ AsyncTaskAndContext swift_task_create_f(JobFlags flags,
5843
using FutureAsyncSignature =
5944
AsyncSignature<void(void*), /*throws*/ true>;
6045

61-
/// Create a task object with a future which will run the given
62-
/// function.
63-
///
64-
/// The task is not yet scheduled.
65-
///
66-
/// If a parent task is provided, flags.task_hasChildFragment() must
67-
/// be true, and this must be called synchronously with the parent.
68-
/// The parent is responsible for creating a ChildTaskStatusRecord.
69-
/// TODO: should we have a single runtime function for creating a task
70-
/// and doing this child task status record management?
71-
///
72-
/// flags.task_isFuture must be set. \c futureResultType is the type
73-
///
74-
SWIFT_EXPORT_FROM(swift_Concurrency) SWIFT_CC(swift)
75-
AsyncTaskAndContext swift_task_create_future(
76-
JobFlags flags, AsyncTask *parent, const Metadata *futureResultType,
77-
const FutureAsyncSignature::FunctionPointer *function);
78-
7946
/// Create a task object with a future which will run the given
8047
/// function.
8148
SWIFT_EXPORT_FROM(swift_Concurrency) SWIFT_CC(swift)

include/swift/Runtime/RuntimeFunctions.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1502,7 +1502,7 @@ FUNCTION(TaskCancel,
15021502
ARGS(SwiftTaskPtrTy),
15031503
ATTRS(NoUnwind, ArgMemOnly))
15041504

1505-
// AsyncTaskAndContext swift_task_create(
1505+
// AsyncTaskAndContext swift_task_create_f(
15061506
// size_t flags, AsyncTask *task,
15071507
// TaskContinuationFunction* function,
15081508
// size_t contextSize);

stdlib/public/Concurrency/Task.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -212,13 +212,6 @@ static void completeTask(AsyncTask *task, ExecutorRef executor,
212212
swift_release(task);
213213
}
214214

215-
AsyncTaskAndContext
216-
swift::swift_task_create(JobFlags flags, AsyncTask *parent,
217-
const ThinNullaryAsyncSignature::FunctionPointer *function) {
218-
return swift_task_create_f(flags, parent, function->Function.get(),
219-
function->ExpectedContextSize);
220-
}
221-
222215
AsyncTaskAndContext
223216
swift::swift_task_create_f(JobFlags flags, AsyncTask *parent,
224217
ThinNullaryAsyncSignature::FunctionType *function,
@@ -227,15 +220,6 @@ swift::swift_task_create_f(JobFlags flags, AsyncTask *parent,
227220
flags, parent, nullptr, function, initialContextSize);
228221
}
229222

230-
AsyncTaskAndContext swift::swift_task_create_future(
231-
JobFlags flags, AsyncTask *parent,
232-
const Metadata *futureResultType,
233-
const FutureAsyncSignature::FunctionPointer *function) {
234-
return swift_task_create_future_f(
235-
flags, parent, futureResultType, function->Function.get(),
236-
function->ExpectedContextSize);
237-
}
238-
239223
AsyncTaskAndContext swift::swift_task_create_future_f(
240224
JobFlags flags, AsyncTask *parent,
241225
const Metadata *futureResultType,

0 commit comments

Comments
 (0)