[Mingw-w64-public] semaphore wrappers patch

2013-11-19 Thread Edscott Wilson
Here is a patch for posix semaphores. I've made a bunch of corrections suggested by dw. I've applied the patch to my local mingw-w64 and generated a new dll and replaced the old one and the example program of libtubo (git version) works just fine. I'll be testing parallel makes next as unnamed

Re: [Mingw-w64-public] semaphore wrappers

2013-11-14 Thread LRN
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 14.11.2013 2:27, Edscott Wilson wrote: Here's the code for using named and unnamed semaphores in Mingw-w64. The only function I have not tested (but looks OK now) is _sem_timedwait(). Code is included in libtubo release 5.0.12

Re: [Mingw-w64-public] semaphore wrappers

2013-11-14 Thread Edscott Wilson
If there is any interest in including the code in ming-w64, I would have no problem in changing the license to that which is used by mingw-w64. Otherwise, anybody who wants to use the code is free to use it under GPL, which is what I use as a matter of habit. 2013/11/14 LRN lrn1...@gmail.com

Re: [Mingw-w64-public] semaphore wrappers

2013-11-14 Thread JonY
On 11/15/2013 06:15, JonY wrote: On 11/14/2013 23:42, Edscott Wilson wrote: If there is any interest in including the code in ming-w64, I would have no problem in changing the license to that which is used by mingw-w64. Otherwise, anybody who wants to use the code is free to use it under GPL,

Re: [Mingw-w64-public] semaphore wrappers

2013-11-14 Thread dw
My mistake, winpthreads itself is BSD, so is it OK to license it as BSD for mingw-w64? If we are going to look at adopting this code, there are few things in it that should be reviewed first. I saw a few when it was first posted, but dropped them when I saw there were licensing issues.

Re: [Mingw-w64-public] semaphore wrappers

2013-11-14 Thread Edscott Wilson
2013/11/14 dw limegreenso...@yahoo.com My mistake, winpthreads itself is BSD, so is it OK to license it as BSD for mingw-w64? If we are going to look at adopting this code, there are few things in it that should be reviewed first. I saw a few when it was first posted, but dropped them

Re: [Mingw-w64-public] semaphore wrappers

2013-11-13 Thread Edscott Wilson
Here's the code for using named and unnamed semaphores in Mingw-w64. The only function I have not tested (but looks OK now) is _sem_timedwait(). Code is included in libtubo release 5.0.12 (http://xffm.org/libtubo.html) with GPLV3, so if it is of any use, feel free to use it. I've prepared

Re: [Mingw-w64-public] semaphore wrappers

2013-11-11 Thread Edscott Wilson
2013/11/9 dw limegreenso...@yahoo.com handle = CreateSemaphore(NULL, (LONG) value, (LONG) 1024, name); Why 1024? Is this the same as SEM_VALUE_MAX? Probably not the same. I'm now changing it to SEM_VALUE_MAX. if (handle == NULL){ LPTSTR buffer; errno =

Re: [Mingw-w64-public] semaphore wrappers

2013-11-09 Thread dw
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

[Mingw-w64-public] semaphore wrappers

2013-11-08 Thread Edscott Wilson
Here's some code to enable named semaphores as defined in semaphore.h. I've tested it with the libtubo example program and all seems to work well. The only caveat is that windows will unlink the semaphore when the last process closes the semaphore. This goes hand in hand with the inability of