Hi, everyone. First of all, I'm so sorry that I can't speak English Well.
I wonder about thread id. Please look at codes below.
using UnityEngine;
using System.Collections;
using System.Threading;
public class TestScript : MonoBehaviour {
void Start () {
Debug.Log("current thread id: " + Thread.CurrentThread.GetHashCode().ToString());
(new Thread(thread_test)).Start();
}
static void thread_test()
{
Debug.Log("created thread id: " + Thread.CurrentThread.GetHashCode().ToString());
}
}
And I got the result below with console panel.
current thread id: 1
created thread id: 1
I expected the result below.
current thread id: 1
created thread id: 2
Why is 'created thread id' 1? Why isn't it 2? Are 'current thread' and 'created thread' the same thread?
Please tell me about that.
Same deal here, still. Utiny and/or Mono seem to be playing games with us regarding thread ids. I'm positive I'm on a different thread when I call this, yet I get a 1 too always no matter what. WTF??
– RosaurarosciusSeems I posted as a comment instead of an answer.. Just wanted to say my problem went away the moment I left the editor. It seems this behaviour only occurs inside the editor, not in a build. Kinda screwed for testing purposes, fortunately it's a non-issue for me now..
– Rosauraroscius