Skip to content

Commit 26f4e2a

Browse files
committed
[libc][docs] Fix the RPC documentation leaking ports
Summary: Forgot to close it, that'll make it deadlock after awhile.
1 parent 2cbf279 commit 26f4e2a

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)