Created
April 3, 2012 21:59
-
-
Save TalhaAkkas/2295787 to your computer and use it in GitHub Desktop.
thread orneği gibi bi şeyler olsun
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <pthread.h> | |
void print_message_function ( void *ptr ); | |
int main() | |
{ | |
pthread_t thread1, thread2; | |
thdata data1, data2; | |
char *strone = "naber dostum"; | |
char *strtwo = "bana bunu yapmayacaktın anton"; | |
pthread_create (&thread1, NULL, (void *) &print_message_function, (void *) strone, 1); | |
pthread_create (&thread2, NULL, (void *) &print_message_function, (void *) strtwo, 2); | |
pthread_join(thread1, NULL); | |
pthread_join(thread2, NULL); | |
getch(); | |
exit(0); | |
} | |
void print_message_function ( void *ptr , int i ) | |
{ | |
printf("Thread %d diyo ki %s \n", i, ptr); | |
pthread_exit(0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment