[Mono-osx] #define and Operating System Specific Code

Stifu stifu at free.fr
Fri Oct 14 09:52:02 EDT 2011


You can detect the OS at runtime.

http://mono.wikia.com/wiki/Detecting_the_execution_platform


Andrew Ayre wrote:
> 
> Following on from my previous question are there any suggestions on how
> to write cross-platform code that uses threads? Currently I have:
> 
> Thread SerialThread = new Thread(new ThreadStart(SerialHandler));
> ...
> SerialThread.Start();
> 
> private void SerialHandler()
> {
>   NSAutoreleasePool Pool = new NSAutoreleasePool();
>   ...
>   Pool.Dispose();
>   Pool = null;
> }
> 
> For Windows and Linux I want to omit the autorelease pool code. I'm sure
> there must be a clever way that doesn't involve #if/#endif.
> 
> thanks, Andy
> 
> On 10/12/2011 3:52 PM, Andrew Ayre wrote:
>> Hi, where can I find a list of compiler defines that Mono provides to
>> identify the current operating system?
>> 
>> Thanks, Andy
>> 
> 
> -- 
> Andy
> PGP Key ID: 0xDC1B5864
> _______________________________________________
> Mono-osx mailing list
> Mono-osx at .ximian
> http://lists.ximian.com/mailman/listinfo/mono-osx
> 


--
View this message in context: http://mono.1490590.n4.nabble.com/define-and-Operating-System-Specific-Code-tp3898256p3904918.html
Sent from the Mono - OSX mailing list archive at Nabble.com.


More information about the Mono-osx mailing list