You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: resize.rs
    path of file: ./repos/cursive/cursive/src/backends
    
    the code of the file until where you have to start completion: use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;
use std::thread;

use crossbeam_channel::Sender;
use signal_hook::iterator::Signals;

/// This starts a new thread to listen for SIGWINCH signals
#[allow(unused)]
pub fn start_resize_thread(resize_sender: Sender<()>, resize_running: Arc<AtomicBool>) {
    let mut signals = Signals::new([libc::SIGWINCH]).unwrap();
    thr
    
pub fn start_resize_thread(resize_sender: Sender<()>, resize_running: Arc<AtomicBool>) {
    let mut signals = Signals::new([libc::SIGWINCH]).unwrap();
    thread::spawn(move || {
        // This thread will listen to SIGWINCH events and report them.
        while resize_running.load(Ordering::Relaxed) {
            // We know it will only contain SIGWINCH signals, so no need to check.
            if signals.wait().count() > 0 && resize_sender.send(()).is_err() {
                return;
            }
        }
    });
}