handle = CreateSemaphore(NULL, (LONG) value, (LONG) 1024, name);

Why 1024?  Is this the same as SEM_VALUE_MAX?

    if (handle == NULL){
        LPTSTR buffer;
        errno = EINVAL;
        return (_sem_t *)SEM_FAILED;
    }

What's the "buffer" for?

static int _sem_timedwait(_sem_t *sem, const struct timespec *abs_timeout){
    long milliseconds = abs_timeout->tv_sec * 1000;
    milliseconds += (abs_timeout->tv_nsec/1000000);
    tubo_sem_timeout(sem, milliseconds);
}

This doesn't appear to match the man page <http://man7.org/linux/man-pages/man3/sem_wait.3.html> I read: "If the timeout has already expired by the time of the call" implies that an absolute time is being specified, not a duration. While I think your definition is more useful, this may result in unexpected behavior for others.

FWIW,
dw

------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to