Skip to content

Instantly share code, notes, and snippets.

@TalhaAkkas
Created April 3, 2012 21:59
Show Gist options
  • Save TalhaAkkas/2295787 to your computer and use it in GitHub Desktop.
Save TalhaAkkas/2295787 to your computer and use it in GitHub Desktop.
thread orneği gibi bi şeyler olsun
#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