Skip to content

Commit

Permalink
worked
Browse files Browse the repository at this point in the history
  • Loading branch information
pipetky committed Dec 11, 2018
1 parent 6ecfea4 commit 547846f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#define ERROR_JOIN_THREAD -12
#define SUCCESS 0

void * helloWorld(FILE * file) {
void * file_read_th(FILE * file) {
char str[1024];
while (fscanf(file, "%s", str) != EOF)
{
Expand All @@ -32,9 +32,9 @@ int main() {
FILE *f = fopen("file.txt", "r");
pthread_t thread;
int status;
// void * status_addr;

status = pthread_create(&thread, NULL, helloWorld, f);

status = pthread_create(&thread, NULL, file_read_th, f);
if (status != SUCCESS) {
printf("main error: can't create thread, status = %d\n", status);
exit(ERROR_CREATE_THREAD);
Expand Down

0 comments on commit 547846f

Please sign in to comment.