home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cbmvax!peter
- From: peter@cbmvax.commodore.com (Peter Cherna)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Screen lists & locking
- Message-ID: <37995@cbmvax.commodore.com>
- Date: 17 Dec 92 15:54:41 GMT
- References: <ByywFv.Mzx@fc.hp.com> <37878@cbmvax.commodore.com> <dUH8s*N82@swinjm.adsp.sub.org>
- Reply-To: peter@cbmvax.commodore.com (Peter Cherna)
- Organization: Commodore-Amiga, Inc. West Chester, PA.
- Lines: 41
-
- In article <dUH8s*N82@swinjm.adsp.sub.org> forgeas@swinjm.adsp.sub.org (Jean-Michel Forgeas) writes:
- >In article <37878@cbmvax.commodore.com>, Peter Cherna writes:
- >
- >> list = LockPubScreenList();
- >>
- >> /* Now find the node */
- >> strcpy( mybuffer, node->ln_Name );
- >>
- >> UnlockPubScreenList();
- >>
- >> /* This happens outside LockPubScreenList(). Also, there
- >> * is no need to LockPubScreen() first.
- >> */
- >> SetDefaultPubScreen(node->ln_Name);
- >
- >In the example above, can the screen (called node->ln_Name) be closed
- >just after UnlockPubScreenList() and just before SetDefaultPubScreen(),
- >so that SetDefaultPubScreen(node->ln_Name) could fail?
-
- Of course SetDefaultPubScreen() can fail, but it's safe to call it
- with the name of a screen that's vanished. If you want to know if
- it'll fail, replace the call to SetDefaultPubScreen() with a sequence
- of:
-
- if ( LockPubScreen( mybuffer ) )
- {
- SetDefaultPubScreen( mybuffer );
- UnlockPubScreen( mybuffer, NULL );
- }
-
- Note that the original code I posted had an error. The call to
- SetDefaultPubScreen() should have had mybuffer as its parameter.
-
- > Jean-Michel
-
- Peter
- --
- Peter Cherna, User Interface Development Group, Commodore-Amiga, Inc.
- {uunet|rutgers}!cbmvax!peter peter@cbmvax.commodore.com
- My opinions do not necessarily represent the opinions of my employer.
- "Opinions enlarged to show detail"
-