asmttpd
asmttpd copied to clipboard
Missing memory fences in mutexes
https://en.m.wikipedia.org/wiki/Memory_barrier#Multithreaded_programming_and_memory_visibility
You need mfence/lfence/sfence before mutex_lock() returns, and before unlock() returns.
Thread 1: Lock A=1 Unlock
Thread 2: Lock Read A. May see old, not updated by thread 1 value.