bufObj->RefCount = -1000;
bufObj->Name = ~0;
+ _glthread_DESTROY_MUTEX(bufObj->Mutex);
_mesa_free(bufObj);
}
GLboolean deleteFlag = GL_FALSE;
struct gl_buffer_object *oldObj = *ptr;
- /*_glthread_LOCK_MUTEX(oldObj->Mutex);*/
+ _glthread_LOCK_MUTEX(oldObj->Mutex);
ASSERT(oldObj->RefCount > 0);
oldObj->RefCount--;
#if 0
(void *) oldObj, oldObj->Name, oldObj->RefCount);
#endif
deleteFlag = (oldObj->RefCount == 0);
- /*_glthread_UNLOCK_MUTEX(oldObj->Mutex);*/
+ _glthread_UNLOCK_MUTEX(oldObj->Mutex);
if (deleteFlag) {
if (bufObj) {
/* reference new buffer */
- /*_glthread_LOCK_MUTEX(tex->Mutex);*/
+ _glthread_LOCK_MUTEX(bufObj->Mutex);
if (bufObj->RefCount == 0) {
/* this buffer's being deleted (look just above) */
/* Not sure this can every really happen. Warn if it does. */
#endif
*ptr = bufObj;
}
- /*_glthread_UNLOCK_MUTEX(tex->Mutex);*/
+ _glthread_UNLOCK_MUTEX(bufObj->Mutex);
}
}
(void) target;
_mesa_bzero(obj, sizeof(struct gl_buffer_object));
+ _glthread_INIT_MUTEX(obj->Mutex);
obj->RefCount = 1;
obj->Name = name;
obj->Usage = GL_STATIC_DRAW_ARB;