Skip to content

Commit 1a245fb

Browse files
jhuber6github-actions[bot]
authored andcommitted
Automerge: [libc][docs] Fix the RPC documentation leaking ports
Summary: Forgot to close it, that'll make it deadlock after awhile.
2 parents 7783ef2 + 26f4e2a commit 1a245fb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

libc/docs/gpu/rpc.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,11 @@ but the following example shows how it can be used by a standard user.
231231
do {
232232
auto port = server.try_open(warp_size, /*index=*/0);
233233
// From libllvmlibc_rpc_server.a in the installation.
234-
if (port)
235-
handle_libc_opcodes(*port, warp_size);
234+
if (!port)
235+
continue;
236+
237+
handle_libc_opcodes(*port, warp_size);
238+
port->close();
236239
} while (cudaStreamQuery(stream) == cudaErrorNotReady);
237240
}
238241

0 commit comments

Comments
 (0)