
30 Sep
2004
30 Sep
'04
7:41 p.m.
[snip]
...so that InterlockedCompareExchange fails and returns 1, so this doesn't return; and suppose that another thread decrements the count to 0 around here...
else return InterlockedIncrement(&value);
...then this increments the count to 1, which is wrong.
Yup, you are right. Thanks. Best, John -- John Torjo -- john@torjo.com Contributing editor, C/C++ Users Journal -- "Win32 GUI Generics" -- generics & GUI do mix, after all -- http://www.torjo.com/win32gui/ -- v1.4 - save_dlg - true binding of your data to UI controls! + easily add validation rules (win32gui/examples/smart_dlg)