MCPcopy Create free account
hub / github.com/apache/datafusion / drop

Method drop

datafusion-examples/examples/query_planning/thread_pools.rs:298–313  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

296
297impl Drop for CpuRuntime {
298 fn drop(&mut self) {
299 // Notify the thread to shutdown.
300 self.notify_shutdown.notify_one();
301 // In a production system you also need to ensure your code stops adding
302 // new tasks to the underlying runtime after this point to allow the
303 // thread to complete its work and exit cleanly.
304 if let Some(thread_join_handle) = self.thread_join_handle.take() {
305 // If the thread is still running, we wait for it to finish
306 print!("Shutting down CPU runtime thread...");
307 if let Err(e) = thread_join_handle.join() {
308 eprintln!("Error joining CPU runtime thread: {e:?}",);
309 } else {
310 println!("CPU runtime thread shutdown successfully.");
311 }
312 }
313 }
314}
315
316impl CpuRuntime {

Callers

nothing calls this directly

Calls 2

takeMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected