All pastes #495656 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-05-18 21:39 UTC
rendered paste body


#include "pthread.h"
#include "sched.h"
#include "semaphore.h"

#include <windows.h>
#include <iostream>

static int washere = 0;
float tehfloat=5;
void * func(void * arg)
{int i;
  for(i=0;i<10000;i++)
  {tehfloat+=1;
    printf("yah thread %f",tehfloat);
  }
  return 0;
}

int
main()
{
  pthread_t t;
int i;
pthread_create(&t, NULL, func, NULL);
 for(i=0;i<10000;i++)
  {tehfloat+=1;
     printf("yay normal %f",tehfloat);
  }
  
  Sleep(2000);



  return 0;
}