#include int pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *mutexattr); int pthread_mutex_lock(pthread_mutex_t *mutex); int pthread_mutex_unlock(pthread_mutex_t *mutex); int pthread_mutex_destroy(pthread_mutex_t *mutex);
$ cc -D_REENTRANT -I/usr/include/nptl thread4.c –o thread4 -L/usr/lib/nptl - lpthread $ ./thread4 Input some text. Enter ‘end’ to finish Whit You input 4 characters The Crow Road You input 13 characters end Waiting for thread to finish... Thread joined