wgl: Un-inline helpers which use stw_own_mutex
Reviewed-by: Charmaine Lee <charmainel@vmware.com> Reviewed By: Bill Kristiansen <billkris@microsoft.com> Acked-by: Roland Scheidegger <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
This commit is contained in:
parent
7d96e19b92
commit
9c875b040c
|
@ -333,6 +333,33 @@ stw_framebuffer_create(HDC hdc, int iPixelFormat, enum stw_framebuffer_owner own
|
|||
return fb;
|
||||
}
|
||||
|
||||
/**
|
||||
* Increase fb reference count. The referenced framebuffer should be locked.
|
||||
*
|
||||
* It's not necessary to hold stw_dev::fb_mutex global lock.
|
||||
*/
|
||||
void
|
||||
stw_framebuffer_reference_locked(struct stw_framebuffer *fb)
|
||||
{
|
||||
if (fb) {
|
||||
assert(stw_own_mutex(&fb->mutex));
|
||||
fb->refcnt++;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Release stw_framebuffer::mutex lock. This framebuffer must not be accessed
|
||||
* after calling this function, as it may have been deleted by another thread
|
||||
* in the meanwhile.
|
||||
*/
|
||||
void
|
||||
stw_framebuffer_unlock(struct stw_framebuffer *fb)
|
||||
{
|
||||
assert(fb);
|
||||
assert(stw_own_mutex(&fb->mutex));
|
||||
LeaveCriticalSection(&fb->mutex);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update the framebuffer's size if necessary.
|
||||
|
|
|
@ -160,14 +160,8 @@ stw_framebuffer_create(HDC hdc, int iPixelFormat, enum stw_framebuffer_owner own
|
|||
*
|
||||
* It's not necessary to hold stw_dev::fb_mutex global lock.
|
||||
*/
|
||||
static inline void
|
||||
stw_framebuffer_reference_locked(struct stw_framebuffer *fb)
|
||||
{
|
||||
if (fb) {
|
||||
assert(stw_own_mutex(&fb->mutex));
|
||||
fb->refcnt++;
|
||||
}
|
||||
}
|
||||
void
|
||||
stw_framebuffer_reference_locked(struct stw_framebuffer *fb);
|
||||
|
||||
|
||||
void
|
||||
|
@ -214,13 +208,8 @@ stw_framebuffer_lock(struct stw_framebuffer *fb)
|
|||
* after calling this function, as it may have been deleted by another thread
|
||||
* in the meanwhile.
|
||||
*/
|
||||
static inline void
|
||||
stw_framebuffer_unlock(struct stw_framebuffer *fb)
|
||||
{
|
||||
assert(fb);
|
||||
assert(stw_own_mutex(&fb->mutex));
|
||||
LeaveCriticalSection(&fb->mutex);
|
||||
}
|
||||
void
|
||||
stw_framebuffer_unlock(struct stw_framebuffer *fb);
|
||||
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue