"#include <pthread.h>" added