Small changes to code, added README
This commit is contained in:
10
threads-intro/README.md
Normal file
10
threads-intro/README.md
Normal 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.
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user