Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
488 B
1
Indexable
Never
#include <stdio.h>
#include <pthread.h>
#include <assert.h>
//#include "common.h"
//#include "common_threads.h"

void* mythread(void* arg)
{
	printf("&s\n", (char*)arg);
	return NULL;
}
int main(int argc, char* argv[])
{
	pthread_t p1, p2;
	int rc;
	printf("main: begin\n");
	Pthread_create(&p1, NULL, mythread, "A");
	Pthread_create(&p2, NULL, mythread, "B");
	//join waits for these threads to finish
	Pthread_join(p1, NULL);
	Phread_join(p2, NULL);
	printf("main: end\n");
	return 0;
}