Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!apple!usc!samsung!munnari.oz.au!metro!grivel!gara!ndunstan From: ndunstan@gara.une.oz.au (Neil Dunstan) Newsgroups: comp.unix.internals Subject: Trouble using semctl Message-ID: <5456@gara.une.oz.au> Date: 25 Feb 91 23:27:23 GMT Reply-To: ndunstan@gara.une.oz.au (Neil Dunstan) Organization: Uni. of New England, Armidale, NSW. Lines: 35 semctl( semarray_id, 0, GETNCNT, 0 ) sometimes returns 0 unexpectedly. I'm using it in a loop to test when a process has been released from a semaphore queue. i.e. oldcount = semctl( semarray_id, 0, GETNCNT, 0 ) while( (newcount = semctl( semarray_id, 0, GETCNT, 0 )) != oldcount-1 ) semop( ... /* increase semaphore value by one */ Does anyone know why this shouldn't work? Thanks. Newsgroups: comp.unix.internals Subject: Problem with semctl Expires: References: Sender: Reply-To: neil@neumann.une.oz (Neil Dunstan) Followup-To: Distribution: world Organization: University of New England, Armidale, Australia Keywords: semctl( semarray_id, 0, GETNCNT, 0 ) sometimes returns 0 unexpectedly. I'm using it in a loop to test when a process has been released from a semaphore queue. i.e. oldcount = semctl( semarray_id, 0, GETNCNT, 0 ) while( (newcount = semctl( semarray_id, 0, GETCNT, 0 )) != oldcount-1 ) semop( ... /* increase semaphore value by one */ Does anyone know why this shouldn't work? Thanks. Brought to you by Super Global Mega Corp .com