Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added changes previous not added from previous commit #359

Merged
merged 1 commit into from
Jul 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 5 additions & 16 deletions src/getprop.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,17 +375,6 @@ UpdateProperty(XCBDisplay *display, __Property__Cookie__ *cookie)
__prop_handler[cookie->type].reply_getter(display, cookie, _XCB_COOKIE);
}

static void
GrabQueuedItemWorker(__Property__Cookie__ *cookie_return)
{
/* check for relavent items */
if(!CQueueIsEmpty(&__threads.queue))
{
*cookie_return = __threads.queue_data[__threads.queue.front];
CQueuePop(&__threads.queue);
}
}

void *
Worker(void *x)
{
Expand All @@ -400,11 +389,11 @@ Worker(void *x)
while(cookie.type != PropExitThread)
{
/* wait for stuff to happen */
pthread_mutex_lock(&__threads.queue.mutex);
pthread_cond_wait(&__threads.queue.cond, &__threads.queue.mutex);
pthread_mutex_unlock(&__threads.queue.mutex);
pthread_mutex_lock(&__threads.queue.condmutex);
pthread_cond_wait(&__threads.queue.cond, &__threads.queue.condmutex);
pthread_mutex_unlock(&__threads.queue.condmutex);
/* grab if any item */
GrabQueuedItemWorker(&cookie);
CQueuePop(&__threads.queue, &cookie);

if(cookie.win)
{
Expand Down Expand Up @@ -490,7 +479,7 @@ static void
PropDestroyWorkers(uint32_t threads)
{
while(!CQueueIsEmpty(&__threads.queue))
{ CQueuePop(&__threads.queue);
{ CQueuePop(&__threads.queue, NULL);
}
while(!CQueueIsFull(&__threads.queue))
{ PropListen(NULL, 0, PropExitThread);
Expand Down