home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / amiga / programm / 17358 < prev    next >
Encoding:
Internet Message Format  |  1992-12-14  |  1.6 KB

  1. Path: sparky!uunet!paladin.american.edu!europa.asd.contel.com!darwin.sura.net!spool.mu.edu!uwm.edu!rutgers!cbmvax!peter
  2. From: peter@cbmvax.commodore.com (Peter Cherna)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Screen lists & locking
  5. Message-ID: <37878@cbmvax.commodore.com>
  6. Date: 14 Dec 92 22:31:54 GMT
  7. References: <ByywFv.Mzx@fc.hp.com>
  8. Reply-To: peter@cbmvax.commodore.com (Peter Cherna)
  9. Organization: Commodore-Amiga, Inc.  West Chester, PA.
  10. Lines: 37
  11.  
  12. In article <ByywFv.Mzx@fc.hp.com> koren@fc.hp.com (Steve Koren) writes:
  13. >I'm trying to set a new public screen, and I'm doing something wrong,
  14. >but I don't know what.  My code says:
  15.  
  16. From the autodoc for LockPubScreenList():
  17.     The nodes on the list are PubScreenNode structures.
  18.     Act quickly while holding this lock.  The restrictions
  19.     on LockIBase() apply here as well.
  20.  
  21. So, we look at the autodoc for LockIBase():
  22.     NOTE WELL: Do not call any Intuition functions (nor any graphics,
  23.     layers, dos, or other high-level system function) while
  24.     holding this lock.
  25.  
  26. You're deadlocking because you're violating this, and calling Intuition
  27. functions inside LockPubScreenList().  Try:
  28.  
  29.     list = LockPubScreenList();
  30.  
  31.     /* Now find the node */
  32.     strcpy( mybuffer, node->ln_Name );
  33.  
  34.     UnlockPubScreenList();
  35.  
  36.     /* This happens outside LockPubScreenList().  Also, there
  37.      * is no need to LockPubScreen() first.
  38.      */
  39.     SetDefaultPubScreen(node->ln_Name);
  40.  
  41. >   - steve
  42.  
  43.      Peter
  44. --
  45. Peter Cherna, User Interface Development Group, Commodore-Amiga, Inc.
  46. {uunet|rutgers}!cbmvax!peter    peter@cbmvax.commodore.com
  47. My opinions do not necessarily represent the opinions of my employer.
  48. "Opinions enlarged to show detail"
  49.