------- Comment #60 from rwild at gcc dot gnu dot org 2010-06-03 10:33 ------- (In reply to comment #59) > Why would be volatile needed? pthread_join returning guarantees that the > other > thread's thread function finished, and the variable is only written in that > thread, there is no data race on it.
Does pthread_join imply a memory barrier? IOW, why can the read of a_in_other_thread not be reordered before that? If I'm missing something obvious here, thanks for clarifying. Is this bug just a dupe of PR 44132 now? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43170