From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ross Johnson To: Michael Ambrus Cc: "'pthreads-win32 mailing list'" Subject: Re: semaphores Date: Tue, 20 Apr 1999 19:16:00 -0000 Message-id: References: <000101be8b69$a80724e0$0100a8c0@blade.ambrus.home> X-SW-Source: 1999/msg00017.html On Tue, 20 Apr 1999, Michael Ambrus wrote: > Hi, > I've tried the new semaphores and they seem to work fine except that errno > is not properly set as Ross said. Are you using the 1999-04-07 snapshot? Anything before that should be upgraded. Can you provide me with some code that illustrates the problem? The simple test I wrote (tests/errno1.c in the source tree) checks that two threads can set and retrieve values of errno independently. The test succeeds for MSVC (tested on WinNT) and Mingw32 (tested on Win98). > I'm confused about the "pshared" attribute > though. Should it not be != 0 if the semaphore is to be shared between > processes/treads ? pshared should be non-zero for shared semaphores, however, pthreads-win32 doesn't yet support any process shared objects. So sem_init should return EPERM if you set pshared != 0. +----------------------+---+ | Ross Johnson | | E-Mail: rpj@ise.canberra.edu.au | Info Sciences and Eng|___| | University of Canberra | FAX: +61 6 2015227 | PO Box 1 | | Belconnen ACT 2616 | WWW: http://willow.canberra.edu.au/~rpj/ | AUSTRALIA | +--------------------------+