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.