I am trying to parallelize an algorithm in C. I want to use pthread_barrier_t
but my Ubuntu wsl can't find it for some reason. I have pthread.h
included and I can use the rest of the pthread functions. libthread.a
is installed.
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
/* Error occurs here */
pthread_barrier_t barrier;
Exact error is: "identifier pthread_barrier_t is undefined"
I saw elsewhere it could be the way I'm compiling.
Compiling as follows:
gcc -o test test.c -Wall -std=c99 -lpthread -lm
Also, VS Code can't identify the function.