stw_dev->max_2d_length = 1 << (stw_dev->max_2d_levels - 1);
InitializeCriticalSection(&stw_dev->ctx_mutex);
- pipe_mutex_init( stw_dev->fb_mutex );
+ InitializeCriticalSection(&stw_dev->fb_mutex);
stw_dev->ctx_table = handle_table_create();
if (!stw_dev->ctx_table) {
stw_framebuffer_cleanup();
- pipe_mutex_destroy( stw_dev->fb_mutex );
+ DeleteCriticalSection(&stw_dev->fb_mutex);
DeleteCriticalSection(&stw_dev->ctx_mutex);
FREE(stw_dev->smapi);
CRITICAL_SECTION ctx_mutex;
struct handle_table *ctx_table;
- pipe_mutex fb_mutex;
+ CRITICAL_SECTION fb_mutex;
struct stw_framebuffer *fb_head;
#ifdef DEBUG
}
+static inline void
+stw_lock_framebuffers(struct stw_device *stw_dev)
+{
+ EnterCriticalSection(&stw_dev->fb_mutex);
+}
+
+
+static inline void
+stw_unlock_framebuffers(struct stw_device *stw_dev)
+{
+ LeaveCriticalSection(&stw_dev->fb_mutex);
+}
+
+
#endif /* STW_DEVICE_H_ */
}
}
else if (pParams->message == WM_DESTROY) {
- pipe_mutex_lock( stw_dev->fb_mutex );
+ stw_lock_framebuffers(stw_dev);
fb = stw_framebuffer_from_hwnd_locked( pParams->hwnd );
if (fb)
stw_framebuffer_destroy_locked(fb);
- pipe_mutex_unlock( stw_dev->fb_mutex );
+ stw_unlock_framebuffers(stw_dev);
}
return CallNextHookEx(tls_data->hCallWndProcHook, nCode, wParam, lParam);
*/
pipe_mutex_lock( fb->mutex );
- pipe_mutex_lock( stw_dev->fb_mutex );
+ stw_lock_framebuffers(stw_dev);
fb->next = stw_dev->fb_head;
stw_dev->fb_head = fb;
- pipe_mutex_unlock( stw_dev->fb_mutex );
+ stw_unlock_framebuffers(stw_dev);
return fb;
}
if (fb)
fb->refcnt++;
if (old_fb) {
- pipe_mutex_lock(stw_dev->fb_mutex);
+ stw_lock_framebuffers(stw_dev);
pipe_mutex_lock(old_fb->mutex);
stw_framebuffer_destroy_locked(old_fb);
- pipe_mutex_unlock(stw_dev->fb_mutex);
+ stw_unlock_framebuffers(stw_dev);
}
*ptr = fb;
if (!stw_dev)
return;
- pipe_mutex_lock( stw_dev->fb_mutex );
+ stw_lock_framebuffers(stw_dev);
fb = stw_dev->fb_head;
while (fb) {
}
stw_dev->fb_head = NULL;
- pipe_mutex_unlock( stw_dev->fb_mutex );
+ stw_unlock_framebuffers(stw_dev);
}
if (!stw_dev)
return NULL;
- pipe_mutex_lock( stw_dev->fb_mutex );
+ stw_lock_framebuffers(stw_dev);
fb = stw_framebuffer_from_hdc_locked(hdc);
- pipe_mutex_unlock( stw_dev->fb_mutex );
+ stw_unlock_framebuffers(stw_dev);
return fb;
}
{
struct stw_framebuffer *fb;
- pipe_mutex_lock( stw_dev->fb_mutex );
+ stw_lock_framebuffers(stw_dev);
fb = stw_framebuffer_from_hwnd_locked(hwnd);
- pipe_mutex_unlock( stw_dev->fb_mutex );
+ stw_unlock_framebuffers(stw_dev);
return fb;
}