pancurses icon indicating copy to clipboard operation
pancurses copied to clipboard

*mut i8 cannot be sent between threads safely

Open KhaledSharif opened this issue 7 years ago • 1 comments

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`

KhaledSharif avatar Oct 08 '18 04:10 KhaledSharif

See #47

czipperz avatar Dec 23 '18 20:12 czipperz