Your multithreaded application at times requires access to functions or system services that are not thread safe. There are few completely safe alternatives for calling these functions.
To illustrate the alternatives, consider the example of a program that calls API foo(). Because function foo() is listed as not being thread safe, you need to find a safe way to call it. Two common options are using a global mutual exclusion (mutex) or using a separate job to run the function that is not thread safe.