I use pthread_create(&thread1, &attrs, //... , //...); and need if some condition occured need to kill this thread how to kill this ?
pthread_create(&thread1, &attrs, //... , //...);
Take a look at the pthread_kill() function.
pthread_kill()