Article View: comp.sys.amiga.tech
Article #5399Re: Amiga semaphores (HELP!)
From: Robin Rosenberg INF
Date: Sun, 23 Sep 1990 14:31
Date: Sun, 23 Sep 1990 14:31
17 lines
1160 bytes
1160 bytes
Clearly the documentation on AddSemaphore() is misleading. Set the
name and priority _after_ InitSemaphore(). You don't need to set the
type since InitSemahore() does that. So it becomes:
(Could this be added to introduction to comp.sys.amiga.tech since a lot of
people get bitten by AddSemaphore() )
void LocalAddSemaphore(struct SignalSemaphore *SignalSemaphore, char *name)
{
InitSemaphore(SignalSemaphore);
SignalSemaphore->ss_Link.ln_Name = name;
SignalSemaphore->ss_Link.ln_Pri = 1;
Forbid();
Enqueue(&SysBase->SemaphoreList,SignalSemaphore);
Permit();
}
Technical Details
Message-ID:
<ROSENBER.90Sep23173115@ra.abo.fi>Path:
arc1-ca.pugleaf.net!utzoo!attcan!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!news.funet.fi!ra!rosenberReferences:
<2290004@hp-ptp.HP.COM> <2290006@hp-ptp.HP.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!news.funet.fi!ra!rosenber From: rosenber@ra.abo.fi (Robin Rosenberg INF) Newsgroups: comp.sys.amiga.tech Subject: Re: Amiga semaphores (HELP!) Message-ID: <ROSENBER.90Sep23173115@ra.abo.fi> Date: 23 Sep 90 14:31:15 GMT References: <2290004@hp-ptp.HP.COM> <2290006@hp-ptp.HP.COM> Sender: rosenber@ra.abo.fi Organization: Abo Akademi University, Finland Lines: 17 In-reply-to: jimg@hp-ptp.HP.COM's message of 21 Sep 90 16:10:58 GMT