Skip to content

*mut magic_sys::magic_set cannot be shared between threads safely #180

Closed Answered by robo9k
jkoop asked this question in Q&A
Discussion options

You must be logged in to vote

Upon first look, this is a variation of robo9k/rust-magic-sys#28
The problem being that LoadError<> contains the original Cookie<> so you can recover it, but this is a raw pointer from libmagic without enough guarantees to make it Send nor Sync.

You could map this to your own error and thus discard the private !Sync field.
Currently LoadError doesn't expose much beyond std:error::Error, so if you actually need access to its internals, let me know.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by jkoop
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants