Skip to content

Commit d80fe9e

Browse files
committed
clarify comment on usage of UnsafeTransfer
1 parent d22b973 commit d80fe9e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Plugins/AWSLambdaPackager/PluginUtils.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ struct Utils {
3535
defer { fclose(stdout) }
3636

3737
// We need to use an unsafe transfer here to get the fd into our Sendable closure.
38-
// This transfer is fine, because we guarantee that the code in the outputHandler
39-
// is run before we continue the functions execution, where the fd is used again.
40-
// See `process.waitUntilExit()` and the following `outputSync.wait()`
38+
// This transfer is fine, because we write to the variable from a single SerialDispatchQueue here.
39+
// We wait until the process is run below process.waitUntilExit().
40+
// This means no further writes to output will happen.
41+
// This makes it save for us to read the output
4142
struct UnsafeTransfer<Value>: @unchecked Sendable {
4243
let value: Value
4344
}

0 commit comments

Comments
 (0)