home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!ux1.cso.uiuc.edu!usenet.ucs.indiana.edu!navajo!shulick
- From: shulick@navajo.ucs.indiana.edu (Sam Hulick)
- Subject: Re: Enough talk. FILE: server.c
- Message-ID: <C0JsA8.MIt@usenet.ucs.indiana.edu>
- Sender: news@usenet.ucs.indiana.edu (USENET News System)
- Nntp-Posting-Host: navajo.ucs.indiana.edu
- Organization: Vallen Software
- References: <C0IyF5.9Gv@usenet.ucs.indiana.edu> <38418@cbmvax.commodore.com>
- Date: Fri, 8 Jan 1993 18:20:31 GMT
- Lines: 37
-
- So Forbid() should be used before creating new message ports, and
- finding them? How's this revised version?
-
- ....code....
- Forbid();
- myport = FindPort("Foobar!");
- if (myport)
- {
- if (EasyRequest(NULL, &ereq[SERVER_RUNNING], NULL))
- {
- Permit();
- shutdown(myport);
- }
- else
- {
- Permit();
- CloseLibrary(GfxBase);
- CloseLibrary(IntuitionBase);
- exit(0);
- }
- }
- if (!(myport = CreateMsgPort())) /* Create the port.. */
- {
- Alert(AN_CreatePort);
- exit(0);
- }
- Permit();
-
- I'd put Permit() in shutdown(), but I'm afraid that if Forbid() wasn't
- called, it might crash? Plus, do I need to Forbid() before doing
- DeleteMsgPort() and RemPort()?
-
- --
- // Amiga 3000 ___ \ Sam Hulick: shulick@indiana.edu (NeXTmail OK!)
- // 68030 25 MHz /__/\ \ My opinions wear combat boots. Or whatever.
- \\// OS 2.04 \__\/ / "Walk! Not bloody likely. I am going in a
- \/ / taxi." --George Bernard Shaw
-