thrd_sleep

Rafał Jopek rafaljopek@hotmail.com
Thu Jan 28 23:36:32 GMT 2021


Hi,

What package should be installed ?

I use gcc under Cygwin:
gcc (GCC) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.

C11 standard (ISO/IEC 9899:2011):7.26.5.7
The thrd_sleep function (p: 385)

the code that compiles:
``` c
#include <threads.h>
#include <time.h>
#include <stdio.h>

int main(void)
{
    printf("Time: %s", ctime(&(time_t){time(NULL)}));
    thrd_sleep(&(struct timespec){.tv_sec=1}, NULL);
    printf("Time: %s", ctime(&(time_t){time(NULL)}));
}
```
compile error:
/usr/include/threads.h:30:10: fatal error: machine/_threads.h: No such file or directory
   30 | #include <machine/_threads.h>


- Rafał



More information about the Cygwin mailing list