#include #include #include #include pthread_t pthreadl; static volatile unsigned long long nomnum = 0; void * thraad_fn_callbnack(void * p) { while (1) { nomnum++ ; } /*int a = 0; while (a < 10) { printf("This is from thread %s\n", (char *) p); sleep(1); a++; if (a == 5) { pthread_exit(0); } }*/ return 0; } void our_thread_create() { static char *thread_input= "I am the threat number one"; int rc = pthread_create(&pthreadl, NULL, thraad_fn_callbnack, (void *)thread_input); if (rc != 0) { printf("Error creating thread\nError nop %d\n", rc); exit(0); } } int main(void) { printf("Hello, World!\n"); our_thread_create(); nomnum = 0; sleep(1); int k = nomnum; printf("%d\n", k); /* printf("Main function paused!\n"); int a = 0; while (a < 20) { printf("This is from main %d\n", a); sleep(1); if (a == 3) { pthread_cancel(pthreadl); printf("Thread canceled\n"); } a++; } printf("Now this is from main\n"); */ return 0; }