libyang can be used in multithreaded applications keeping in mind the following rules:
libyang context manipulation (adding new schemas, removing schemas or even printing schemas) is not thread safe and it is supposed to be done in a main thread before any other work with context, schemas or data instances. Destroying the context is supposed to be done when no other thread accesses context, schemas nor data trees,
data parser (lyd_parse*() functions) can be used simultaneously in multiple threads (also the returned ly_errno is thread safe),