pkg/runtime/os_linux.c
void futexwakeup(uint32_t *addr, uint32_t cnt)
{
    int ret = syscall(SYS_futex, addr, FUTEX_WAKE, cnt, NULL, NULL, 0);
    if(ret >= 0)
        return;

    // I don't know that futex wakeup can return
    // EAGAIN or EINTR, but if it does, it would be
    // safe to loop and call futex again.
    printf("futexwakeup addr=%p returned %d\n", addr, ret);
    *(int32_t*)0x1006 = 0x1006;
}
// If any procs are sleeping on addr, wake up at most cnt.
If any procs are sleeping on addr, wake up at most cnt.
If any procs are sleeping on addr wake up at most cnt .
void futexwakeup(uint32_t *addr, uint32_t cnt)
{
    int ret = syscall(SYS_futex, addr, FUTEX_WAKE, cnt, NULL, NULL, 0);
    if(ret >= 0)
        return;
    printf("futexwakeup addr=%p returned %d\n", addr, ret);
    *(int32_t*)0x1006 = 0x1006;
}
void futexwakeup ( uint32_t * addr , uint32_t cnt ) { int ret = syscall ( SYS_futex , addr , FUTEX_WAKE , cnt , NULL , NULL , 0 ) ; if ( ret >= 0 ) return ; printf ( " \n " , addr , ret ) ; * ( int32_t * ) 0x1006 = 0x1006 ; }
If any procs are sleeping on addr, wake up at most cnt.
If any procs are sleeping on addr wake up at most cnt .
// I don't know that futex wakeup can return // EAGAIN or EINTR, but if it does, it would be // safe to loop and call futex again.