#include <stdio.h>
#include <pthread.h>


void *print_message_function( void *ptr )
{
        char *message;
        message = (char *) ptr;
        printf("%s", message);
        fflush(stdout);
        return NULL;
}
  
int main(void)
{
        pthread_t thread1, thread2;
        char *message1 = "Hello ";
        char *message2 = "World";
     
        pthread_create( &thread1, NULL, print_message_function, message1);
        pthread_create( &thread2, NULL, print_message_function, message2);

        printf(".");
        fflush(stdout);

        /* Wait for the threads to finish */
        pthread_join(thread1, NULL); 
        pthread_join(thread2, NULL); 

        printf("\nKonec\n");
        return 0;
}