So i've been looking stuff about usleep()
and all I have found to get rid of this is #define
which i have done... Any ohter suggestion? I need to get rid of this warning... Or any ideas on how to use sleep with miliseconds.
#define _BSB_SOURCE
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <unistd.h>
#include <time.h>
int r = rand() % 1000 +1;
usleep(r*1000);
pthread_mutex_lock (&count_mutex);
You need to remove -std=c99
from your compiler command or use the _XOPEN_SOURCE
macro before including unistd.h
.
If you want you can use -std=gnu99
instead of -std=c99
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With