pancurses
pancurses copied to clipboard
*mut i8 cannot be sent between threads safely
Error description
Error occurs when I'm trying to pass a subwindow to a thread. Subwindow is created from the main window using the subwin function.
Code
let w = create_new_window(
&mut windows_vector,
&main_window,
width_of_windows,
);
let handle =
thread::spawn(move || {process(characters, w)});
Error output
error[E0277]: `*mut i8` cannot be sent between threads safely
--> src/main.rs:118:29
|
118 | thread::spawn(move || {
| ^^^^^^^^^^^^^ `*mut i8` cannot be sent between threads safely
|
= help: within `[closure@src/main.rs:118:43: 120:30 characters:std::string::String, w:pancurses::Window]`, the trait `std::marker::Send` is not implemented for `*mut i8`
= note: required because it appears within the type `pancurses::Window`
= note: required because it appears within the type `[closure@src/main.rs:118:43: 120:30 characters:std::string::String, w:pancurses::Window]`
= note: required by `std::thread::spawn`
See #47