Well I'm trying to deploy my first ever Xbox 360 XNA game which uses multithreading, and I'm trying to put a thread on another hardware thread using the Thread.CurrentThread.SetProcessorAffinity()
function, like so:
#if XBOX360
Thread.CurrentThread.SetProcessorAffinity(new int[] { xbox360UpdateThread });
Thread.CurrentThread.IsBackground = true;
#endif
I have also tried this:
#if XBOX
Thread.CurrentThread.SetProcessorAffinity(new int[] { xbox360UpdateThread });
Thread.CurrentThread.IsBackground = true;
#endif
The compiler is giving me problem with the brackets somewhere in the first instruction above .. In VS2008, all the brackets are underlined with those red markers and I get the following errors:
error CS1519: Invalid token '(' in class, struct, or interface member declaration
error CS1519: Invalid token '{' in class, struct, or interface member declaration
error CS1519: Invalid token '}' in class, struct, or interface member declaration
error CS0116: A namespace does not directly contain members such as fields or methods
if I hide the entire threading directive above, and I compile and run my game on the Xbox 360 .. Only this threading directive is causing a problem ..
Anyone know what am I doing wrong ? I'm using XNA 3.1, not 4.0 ..