So I am creating a basic C program that needs to use multithreading. I am simply trying to apply the code in a very simple example yet it keeps failing with the same error. Does anyone know why? (I realize this code's functionality is useless, just want to know why it's failing.)
/* DriverLib Includes */
#include <ti/devices/msp432p4xx/driverlib/driverlib.h>
/* Standard Includes */
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
int x = 0; //
void *loop_2() {
while(1){
Serial.println("Running from thread ...");
delay(5000);
}
}
// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600); // msp430g2231 must use 4800
pthread_t thread;
pthread_create(&thread, NULL, loop_2, NULL);
}
// the loop routine runs over and over again forever:
void loop() {
Serial.println(x);
delay(5000);
}
}
}
ERROR:
Error: 'pthread_create' was not declared in this scope.