home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!paladin.american.edu!europa.asd.contel.com!darwin.sura.net!spool.mu.edu!uwm.edu!rutgers!cbmvax!peter
- From: peter@cbmvax.commodore.com (Peter Cherna)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Screen lists & locking
- Message-ID: <37878@cbmvax.commodore.com>
- Date: 14 Dec 92 22:31:54 GMT
- References: <ByywFv.Mzx@fc.hp.com>
- Reply-To: peter@cbmvax.commodore.com (Peter Cherna)
- Organization: Commodore-Amiga, Inc. West Chester, PA.
- Lines: 37
-
- In article <ByywFv.Mzx@fc.hp.com> koren@fc.hp.com (Steve Koren) writes:
- >I'm trying to set a new public screen, and I'm doing something wrong,
- >but I don't know what. My code says:
-
- From the autodoc for LockPubScreenList():
- The nodes on the list are PubScreenNode structures.
- Act quickly while holding this lock. The restrictions
- on LockIBase() apply here as well.
-
- So, we look at the autodoc for LockIBase():
- NOTE WELL: Do not call any Intuition functions (nor any graphics,
- layers, dos, or other high-level system function) while
- holding this lock.
-
- You're deadlocking because you're violating this, and calling Intuition
- functions inside LockPubScreenList(). Try:
-
- 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);
-
- > - steve
-
- 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"
-