Home | History | Annotate | Download | only in glthread

Lines Matching refs:wq

686 gl_waitqueue_init (gl_waitqueue_t *wq)
688 wq->array = NULL;
689 wq->count = 0;
690 wq->alloc = 0;
691 wq->offset = 0;
697 gl_waitqueue_add (gl_waitqueue_t *wq)
702 if (wq->count == wq->alloc)
704 unsigned int new_alloc = 2 * wq->alloc + 1;
706 (HANDLE *) realloc (wq->array, new_alloc * sizeof (HANDLE));
712 if (wq->offset > 0)
714 unsigned int old_count = wq->count;
715 unsigned int old_alloc = wq->alloc;
716 unsigned int old_offset = wq->offset;
726 wq->offset = 0;
728 wq->array = new_array;
729 wq->alloc = new_alloc;
737 index = wq->offset + wq->count;
738 if (index >= wq->alloc)
739 index -= wq->alloc;
740 wq->array[index] = event;
741 wq->count++;
747 gl_waitqueue_notify_first (gl_waitqueue_t *wq)
749 SetEvent (wq->array[wq->offset + 0]);
750 wq->offset++;
751 wq->count--;
752 if (wq->count == 0 || wq->offset == wq->alloc)
753 wq->offset = 0;
758 gl_waitqueue_notify_all (gl_waitqueue_t *wq)
762 for (i = 0; i < wq->count; i++)
764 unsigned int index = wq->offset + i;
765 if (index >= wq->alloc)
766 index -= wq->alloc;
767 SetEvent (wq->array[index]);
769 wq->count = 0;
770 wq->offset = 0;