Piotr Caban piotr@codeweavers.com wrote:
+static inline BOOL image_lock(GpImage *image, BOOL *unlock) +{
- LONG id = GetCurrentThreadId(), v;
- v = InterlockedCompareExchange(&image->busy, id, 0);
- *unlock = !v;
- return !v || v==id;
+}
Variable 'v' could have a better naming, for instance 'busy' or 'owner_tid'.
+static inline void image_unlock(GpImage *image, BOOL unlock) +{
- if (unlock) image->busy = 0;
+}
Is that even possible to get image_unlock() called with unlock != TRUE?