🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #4312

Re: Bug in AddSemaphore()!

#4312
From: Robin Rosenberg INF
Date: Tue, 10 Jul 1990 14:44
44 lines
1903 bytes
!This may already be widely known, but here it is:
!
!I think, that I have found a bug in the AddSemaphore() routine in
!exec.library.

It is even documented!, with a workaround reading like this

#include <exec/execbase.h>
...
AddSemaphore(s)
struct SignalSemaphore *s
{
	InitSemaphore(s);
	Forbid();
	Enqueue(&SysBase->SemaphoreList,s);
	Permit();
}

[...]

!While trying to track down a spurious bug in the project that I am currently 
!working on, I looked into the code for RemSemaphore() because the .fd files
!that I have indicate, that RemSemaphore() should have its argument in A0,
!(this is a heavy assembler-addict writing! :-> ), while all other Rem-routines
!have their pointer in A1 for easy use with Remove(). And right enough, the
!ROM code expects the pointer in A1. So the .fd file was incorrect in one 
!place, maybe it was with AddSemaphore() too.

The (Lattice 5.05) #pragma for RemSemaphore was also incorrect. Apparently
the stub in Amiga.lib is correct since things worked when I removed the
<proto/exec.h> include. It should read:

	#pragma syscall RemSemaphore 25e 801 

(I think it was 25e 901)

!If asked (a lot) I might make some sort of patch...

Just encourage people to get the latest available docs. The RKM
Includes&Autodocs for 1.3 has been available for quite a while now. 

-----------
Robin Rosenberg
Technical Details
Message-ID: <ROSENBER.90Jul10174434@ra.abo.fi>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!tut!ra!rosenber
References: <1990Jul9.185240.8666@daimi.dk>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!tut!ra!rosenber
From: rosenber@ra.abo.fi (Robin Rosenberg INF)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Bug in AddSemaphore()!
Message-ID: <ROSENBER.90Jul10174434@ra.abo.fi>
Date: 10 Jul 90 14:44:34 GMT
References: <1990Jul9.185240.8666@daimi.dk>
Sender: rosenber@ra.abo.fi
Organization: Abo Akademi University, Finland
Lines: 44
In-reply-to: poe@daimi.dk's message of 9 Jul 90 18:52:40 GMT