In reply to marathuteja:
In this particular example, it makes no difference if ‘a’ is declared with a static or automatic lifetime. There is only one instance of the variable ‘a’ shared between the two threads. And yes, it is a race condition which thread starts first