The C Statistics API can be used safely in multithreaded mode, with the following restrictions:
The same file descriptor is shared among all threads; therefore, all threads also share the same event mask. This means that if two threads call ba_get_next_event() at the same time, you cannot control which thread receives notification of the event.
The ba_enable_signal() function should not be used in multithreaded mode, unless the signal mask has been correctly defined using the thr_sigsetmak() or pthread_sigmak() library functions.
There is one variable ba_errno for each thread; therefore its value should always be checked in the thread from which the API was called.