I have a program that has a main thread and a second thread. The second thread modifies a global variable which then will be used in the main thread. But somehow the changes I make in the second thread are not shown in the main thread.
section .bss USE32
global var
var resd 1
section .text USE32
..start:
push 0
push 0
push 0
push .second
push 0
push 0
call [CreateThread]
mov eax, 1
cmp [var], eax ; --> the content of var and '1' are not the same. Which is confusing since I set the content of var to '1' in the second thread
;the other code here is not important
.second:
mov eax, 1
mov [var], eax
ret
(This is a simplification of my real program which creates threads in a loop; I haven't tested this exact code.)