Shop Learn
LOCKNEW question. — Parallax Forums

LOCKNEW question.

Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 22,923
edited 2006-03-27 07:01 in Propeller 1
When a lock is first handed out using locknew, is it issued locked, unlocked, or unspecified? I've tried to find this in the docs, but don't see it anywhere. Obviously, in a well-behaved system, it doesn't matter, since nobody else will be trying to access a newly issued lock until they're given the lock number and permission to use it. Until that happens, the requesting program can set it or reset it as required. But it would be interesting to know if it's necessary to unlock a new lock, if you want it unlocked, or to lock it, if you want it locked.

Thanks,
Phil

Comments

  • cgraceycgracey Posts: 13,375
    edited 2006-03-27 07:01
    It will be in an unknown state after issued from LOCKNEW. Of course, either 0 or 1 could be used as either the 'locked' or 'unlocked' state. It's all up to how the programmer uses it.
    Phil Pilgrim (PhiPi) said...
    When a lock is first handed out using locknew, is it issued locked, unlocked, or unspecified? I've tried to find this in the docs, but don't see it anywhere. Obviously, in a well-behaved system, it doesn't matter, since nobody else will be trying to access a newly issued lock until they're given the lock number and permission to use it. Until that happens, the requesting program can set it or reset it as required. But it would be interesting to know if it's necessary to unlock a new lock, if you want it unlocked, or to lock it, if you want it locked.

    Thanks,
    Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Chip Gracey
    Parallax, Inc.

    Post Edited (Chip Gracey) : 3/27/2006 7:05:10 AM GMT
Sign In or Register to comment.