Small changes to code, added README

This commit is contained in:
Remzi Arpaci-Dusseau
2018-09-10 10:39:20 -05:00
parent d051a87a2e
commit 1261012439
3 changed files with 18 additions and 6 deletions

10
threads-intro/README.md Normal file
View File

@@ -0,0 +1,10 @@
A simple set of programs that use threads:
- `t0.c`
- `t1.c`
Each one depends on header files found in `../include`
The Makefile is simplistic but will do.

View File

@@ -1,8 +1,9 @@
#include "common.h"
#include "common_threads.h"
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include "common.h"
#include "common_threads.h"
void *mythread(void *arg) {
printf("%s\n", (char *) arg);

View File

@@ -1,8 +1,9 @@
#include "common.h"
#include "common_threads.h"
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include "common.h"
#include "common_threads.h"
int max;
volatile int counter = 0; // shared global variable