is lib magic thread-safe?

1.1k Views Asked by At

I've been searching around, trying to find an answer. I know that I can create multiple libmagic instances, one for each thread, and that is thread-safe. But can I have a single instance shared between multiple threads?

1

There are 1 best solutions below

1
On BEST ANSWER

No, you cannot share libmagic handle/descriptor between two or more threads, in this sense libmagic is not threadsafe.