The krb5 library is not thread safe. IN practice you may be able to simply put a mutex around context setup (gss_init_sec_context and gss_accept_sec_context) calls and be OK, but this is not guaranteed.