Bug 28510 - NSImage threading check is too restrictive
Summary: NSImage threading check is too restrictive
Status: RESOLVED FIXED
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: Library (Xamarin.Mac.dll) ()
Version: 1.12.0
Hardware: PC Mac OS
: Normal normal
Target Milestone: 2.8.0 (C7)
Assignee: Chris Hamons
URL:
: 34870 36150 ()
Depends on:
Blocks:
 
Reported: 2015-03-27 18:25 UTC by Chris Hamons
Modified: 2015-12-04 20:32 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Chris Hamons 2015-03-27 18:25:52 UTC
See https://forums.xamarin.com/discussion/36839/creating-a-nsimage-on-thread

			System.Threading.ThreadPool.QueueUserWorkItem(delegate {
				NSImage image = new NSImage(new CGSize (50, 50));		
			}, null);

throws but

    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
        NSImage *i = [[NSImage alloc] initWithSize:NSMakeSize(50, 50)];
    
    });

works and the docs

https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Multithreading/ThreadSafetySummary/ThreadSafetySummary.html#//apple_ref/doc/uid/10000057i-CH12-126728

suggest it should work. We need to write up an example and fix up the threading checks.
Comment 1 Miguel de Icaza [MSFT] 2015-12-04 15:12:59 UTC
Done
Comment 2 Chris Hamons 2015-12-04 20:28:42 UTC
*** Bug 36150 has been marked as a duplicate of this bug. ***
Comment 3 Chris Hamons 2015-12-04 20:32:41 UTC
*** Bug 34870 has been marked as a duplicate of this bug. ***