所以我一直在寻找东西,usleep()而我发现摆脱的一切就是#define我所做的……还有其他建议吗?我需要摆脱此警告...或者关于如何在毫秒内使用睡眠的任何想法。
#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);
Run Code Online (Sandbox Code Playgroud)