[libc-commits] [libc] 26f4e2a - [libc][docs] Fix the RPC documentation leaking ports
Joseph Huber via libc-commits
libc-commits at lists.llvm.org
Tue Jan 28 13:27:07 PST 2025
Author: Joseph Huber
Date: 2025-01-28T15:26:10-06:00
New Revision: 26f4e2a701f7c303f18ed8f97d263138e14bcd48
URL: https://github.com/llvm/llvm-project/commit/26f4e2a701f7c303f18ed8f97d263138e14bcd48
DIFF: https://github.com/llvm/llvm-project/commit/26f4e2a701f7c303f18ed8f97d263138e14bcd48.diff
LOG: [libc][docs] Fix the RPC documentation leaking ports
Summary:
Forgot to close it, that'll make it deadlock after awhile.
Added:
Modified:
libc/docs/gpu/rpc.rst
Removed:
################################################################################
diff --git a/libc/docs/gpu/rpc.rst b/libc/docs/gpu/rpc.rst
index 3f312bb9281b38..dde4207df6e491 100644
--- a/libc/docs/gpu/rpc.rst
+++ b/libc/docs/gpu/rpc.rst
@@ -231,8 +231,11 @@ but the following example shows how it can be used by a standard user.
do {
auto port = server.try_open(warp_size, /*index=*/0);
// From libllvmlibc_rpc_server.a in the installation.
- if (port)
- handle_libc_opcodes(*port, warp_size);
+ if (!port)
+ continue;
+
+ handle_libc_opcodes(*port, warp_size);
+ port->close();
} while (cudaStreamQuery(stream) == cudaErrorNotReady);
}
More information about the libc-commits
mailing list