> -----Original Message----- > From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On > Behalf Of Binyamin Dissen > Sent: Tuesday, August 22, 2006 12:40 PM > To: [email protected] > Subject: Re: SETLOCK TEST question please > > On Mon, 21 Aug 2006 11:47:30 -0700 Sail Kim <[EMAIL PROTECTED]> wrote: > > :>When a higher lock than what is being tested is held, what condition > would I get back from SETLOCK TEST? Providing that I'm testing for the CMS > or higher lock which is not held. > > I would expect R15=0. > > SETLOCK TEST in general generates in-line code. > > -- > Binyamin Dissen <[EMAIL PROTECTED]> /snip/
There are two flavors of system locks, SUSPEND and SPIN. Lock hierarchy depends on whether you are testing for a SPIN or a SUSPEND lock. In general, if you want to hold both a suspend lock and a spin lock, then you must obtain the suspend lock first, and then obtain the spin lock. It may be possible to obtain an available SUSPEND lock while holding a SPIN lock, but you cannot use MODE=UNCOND to wait for the SUSPEND lock. If you test for a SPIN lock and it is held, that doesn't say anything about whether you are holding any SUSPEND locks or any lower SPIN locks (unless the particular lock *requires* holding a lower lock). The CMS lock is a SUSPEND lock and it requires holding a local lock, either the LOCAL lock of the home space or the Cross Memory Local (CML) lock of the current primary space for cross memory mode. If SETLOCK indicates you are holding the CMS lock, then you are also holding a local lock. Thus, the answer to the OP question is that SETLOCK will not indicate whether a higher lock is held compared to the lock being tested. As to whether a lower lock is held depends on whether the lock being tested requires holding the lower lock. If there is no requirement, then you must specifically test for holding the lower lock. btw: There was a time in ancient MVS history when the Class Locks Held field could be used for direct comparison to determine whether there were any higher locks held than the lock in question. That was all redesigned who-knows-when, so there is now no easy way (i.e., IBM programming interface) to see the lock hierarchy. Jeffrey D. Smith Principal Product Architect Farsight Systems Corporation 700 KEN PRATT BLVD. #204-159 LONGMONT, CO 80501-6452 303-774-9381 direct 303-484-6170 FAX http://www.farsight-systems.com/ ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html

