• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Weird Threads
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Weird Threads


  • Subject: Weird Threads
  • From: Sam McCandlish <email@hidden>
  • Date: Sat, 7 Feb 2004 12:11:06 -0500

I am trying to use an NSThread for a complex drawing operation. In my custom view, when drawRect is called, I detach to another method in myself. The view draws fine. The problem is that the app still acts like it's not multithreaded, the interface still locks up until the drawing is complete. Any ideas?

Here is the drawRect function:
- (void)drawRect:(NSRect)rect {
[NSThread detachNewThreadSelector:@selector(drawRectThreaded:) toTarget:self withObject:NSStringFromRect(rect)];
return;
}

The first thread seems stuck in the following while the view is drawing (this is copied from the debugger)
#0 0x90017048 in semaphore_wait_signal_trap
#1 0x9000e890 in _pthread_cond_wait
#2 0x92dca068 in -[NSViewHierarchyLock lockForWriting]
#3 0x92dd494c in -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:]
#4 0x92ded8d0 in -[NSView displayIfNeeded]
#5 0x92dfe598 in -[NSWindow displayIfNeeded]
#6 0x92ddecc0 in -[NSImage compositeToPoint:fromRect:operation:fraction:]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
  • Follow-Ups:
    • Re: Weird Threads
      • From: Sam McCandlish <email@hidden>
    • Re: Weird Threads
      • From: Kyle Moffett <email@hidden>
  • Prev by Date: Re: Etched Text
  • Next by Date: Re: [Q] NSScanner -> \t\t how to fix??
  • Previous by thread: Code -NSSavePanel, background-only app, "Replace?" alert ordering
  • Next by thread: Re: Weird Threads
  • Index(es):
    • Date
    • Thread