kravietz / pam_tacplus

TACACS+ protocol client library and PAM module in C. This PAM module support authentication, authorization (account management) and accounting (session management)performed using TACACS+ protocol designed by Cisco.
GNU Lesser General Public License v3.0
132 stars 102 forks source link

Use __thread (thread-local storage) keyword for pthread-safe #113

Open kyeongy opened 6 years ago

kyeongy commented 6 years ago

C99 supports Thread-Local Storage: https://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Thread_002dLocal.html

This patch makes use of "__thread" storage class keyword to make the code pthread-safe without changing the code much:

kravietz commented 5 years ago

Hi @kyeongy did you test if it works on older compilers as well?