"Aaron Ardiri" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > sorry i could not understand ur reply. > > u mean to say that MemHandleLock increases the count and then > > MemHandleUnlock decreases the same count. > > and so the net affect on this count remained zero. Is this waht u mean?? > > if the lock count is greater than 16, it'll barf. end of story. > > so, you should lock and unlock evenly. lock = +1, unlock = -1 > if it dies after 16 locks, if means you have not unlocked at all > = bad.
Check your code paths. What you're seeing is a definite result of mismatched locks and unlocks. You're locking the handle more times than you're unlocking it. for (int i = 0; i < 1000; i++) { MemHandleLock(mh); MemHandleUnlock(mh); } Works fine. That's 1000 locks. Check all possible code paths. You're missing something really obvious. Alan -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/