Quote:Original post by the_eddQuote:Original post by davetylervoid threaded_function(int shared_variable){ while(1) { shared_variable++; thread_sleep(100); //Implementation defined sleep function taking ms param. }}void main_function(int shared_variable){ int temp_var; while(1) { temp_var = shared_variable; thread_sleep(100); }}
shared_variable isn't shared. Each function gets its own copy. I assume this is a thinko when entering the code?
Yes it was, I was at work just typing as I thought. Fortunately I got an answer despite the sloppiness.