Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [NSImage lockFocus] and threads



Brendan,

As I said in the other mail, NSView maintains the focus stack for each thread individually. You can lockFocus/unlockFocus safely from multiple threads. Furthermore, while the main thread is processing -display method, lockFocus in subthreads is blocked. Interaction between your own threads is your responsibility, though.

Aki

On 2001.07.20, at 23:35, Brendan Younger wrote:

From what I hear, this is may or may not be a good thing. The view maintains a queue of lock/unlock calls so you can lock it as many times as you want in one thread, but I'm a bit nervous about the situation where one thread is interrupted inside a drawing call with an -unlockFocus call from the secondary thread. May I suggest that simply from a conceptual point of view, no two threads should ever share a view. For safety's sake, I suggest either putting a healthy number of locks around the view or simply not share it between threads.

Brendan Younger
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev


References: 
 >Re: [NSImage lockFocus] and threads (From: Brendan Younger <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.