好吧,我正在尝试部署我的第一个使用多线程的 Xbox 360 XNA 游戏,并且我正在尝试使用该Thread.CurrentThread.SetProcessorAffinity()
函数将线程放在另一个硬件线程上,如下所示:
#if XBOX360
Thread.CurrentThread.SetProcessorAffinity(new int[] { xbox360UpdateThread });
Thread.CurrentThread.IsBackground = true;
#endif
我也试过这个:
#if XBOX
Thread.CurrentThread.SetProcessorAffinity(new int[] { xbox360UpdateThread });
Thread.CurrentThread.IsBackground = true;
#endif
编译器在上面第一条指令中的某处给了我括号的问题.. 在 VS2008 中,所有括号都带有红色标记下划线,我收到以下错误:
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
如果我隐藏上面的整个线程指令,并且我在 Xbox 360 上编译和运行我的游戏..只有这个线程指令会导致问题..
有人知道我在做什么错吗?我使用的是 XNA 3.1,而不是 4.0 ..