Closed bkchr closed 5 years ago
It's part of the problem, yes. However, Process
cannot be used safely between threads. I'll make another check for linux but I think it shouldn't be Send+Sync
either. I need it internally so I can perform faster computations but that's it.
To fix your issue, you'll have to wrap it inside a Mutex
I guess. I'll certainly modify the internal code so that Process
doesn't implement Send+Sync
anymore.
Sorry for the confusion!
Ahh okay. Good to know :) Thanks for the fast answer! Yeah, then we will adapt our code accordingly.
I opened an issue about it if you want to follow the evolution: #149.
@bkchr: I think you were right: implementing Send
and Sync
traits seem like a better solution so let's go for it. I'll send the PR in the next hours.
Hey, on Linux the
Process
struct implementsSend + Sync
, but not on Windows. We have the following bug report.After looking into the
Process
code for Windows, I think thatHANDLE
is the problem. You probably need to create a pointer wrapper that makesHANDLE
SEND + SYNC
.