Skip to content

Commit 0dee73b

Browse files
committed
tidy
1 parent 1d2b5d0 commit 0dee73b

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

crates/csharp/src/AsyncSupport.cs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,6 @@ public static unsafe void WaitableSetPoll(int waitableHandle)
8585
}
8686
}
8787

88-
internal static void Join(SubtaskStatus subtask, int waitableSetHandle, WaitableInfoState waitableInfoState)
89-
{
90-
AddTaskToWaitables(waitableSetHandle, subtask.Handle, waitableInfoState);
91-
Interop.WaitableJoin(subtask.Handle, waitableSetHandle);
92-
}
93-
9488
internal static void Join(int readerWriterHandle, int waitableHandle, WaitableInfoState waitableInfoState)
9589
{
9690
AddTaskToWaitables(waitableHandle, readerWriterHandle, waitableInfoState);
@@ -123,7 +117,7 @@ public static void WaitableSetDrop(int handle)
123117
Interop.WaitableSetDrop(handle);
124118
}
125119

126-
// unsafe because we are using pointers.
120+
// unsafe because we are using pointers.
127121
public static unsafe void ContextSet(ContextTask* contextTask)
128122
{
129123
Interop.ContextSet(contextTask);
@@ -200,7 +194,7 @@ internal static unsafe Task TaskFromStatus(uint status)
200194
contextTaskPtr = AllocateAndSetNewContext();
201195
}
202196

203-
AsyncSupport.Join(subtaskStatus.Handle, contextTaskPtr->WaitableSetHandle, new WaitableInfoState(tcs));
197+
Join(subtaskStatus.Handle, contextTaskPtr->WaitableSetHandle, new WaitableInfoState(tcs));
204198

205199
return tcs.Task;
206200
}
@@ -229,7 +223,7 @@ public static unsafe Task<T> TaskFromStatus<T>(uint status, Func<T> liftFunc)
229223

230224
var intTaskCompletionSource = new TaskCompletionSource<int>();
231225
var tcs = new LiftingTaskCompletionSource<T>(intTaskCompletionSource, liftFunc);
232-
AsyncSupport.Join(subtaskStatus.Handle, contextTaskPtr->WaitableSetHandle, new WaitableInfoState(intTaskCompletionSource));
226+
Join(subtaskStatus.Handle, contextTaskPtr->WaitableSetHandle, new WaitableInfoState(intTaskCompletionSource));
233227

234228
return tcs.Task;
235229
}
@@ -245,6 +239,7 @@ public static unsafe Task<T> TaskFromStatus<T>(uint status, Func<T> liftFunc)
245239
}
246240
}
247241

242+
// Placeholder, TODO: Needs implementing for async functions that return values.
248243
internal class LiftingTaskCompletionSource<T> : TaskCompletionSource<T>
249244
{
250245
internal LiftingTaskCompletionSource(TaskCompletionSource<int> innerTaskCompletionSource, Func<T> _liftFunc)
@@ -854,12 +849,6 @@ internal WaitableInfoState(ComponentTask<int> componentTaskInt, IFutureStream fu
854849
FutureStream = futureStream;
855850
}
856851

857-
internal WaitableInfoState(ComponentTask componentTask, IFutureStream futureStream)
858-
{
859-
this.componentTask = componentTask;
860-
FutureStream = futureStream;
861-
}
862-
863852
internal WaitableInfoState(TaskCompletionSource<int> taskCompletionSource)
864853
{
865854
this.taskCompletionSource = taskCompletionSource;

0 commit comments

Comments
 (0)