commit
ff43066036
@ -61,7 +61,7 @@ void xf_set_event(xfEventQueue* event_queue)
|
|||||||
printf("xf_set_event: error\n");
|
printf("xf_set_event: error\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void xf_clear_event(xfEventQueue* event_queue)
|
void xf_clear_events(xfEventQueue* event_queue)
|
||||||
{
|
{
|
||||||
int length;
|
int length;
|
||||||
|
|
||||||
@ -74,6 +74,16 @@ void xf_clear_event(xfEventQueue* event_queue)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void xf_clear_event(xfEventQueue* event_queue)
|
||||||
|
{
|
||||||
|
int length;
|
||||||
|
|
||||||
|
length = read(event_queue->pipe_fd[0], &length, 4);
|
||||||
|
|
||||||
|
if (length != 4)
|
||||||
|
printf("xf_clear_event: error\n");
|
||||||
|
}
|
||||||
|
|
||||||
void xf_event_push(xfEventQueue* event_queue, xfEvent* event)
|
void xf_event_push(xfEventQueue* event_queue, xfEvent* event)
|
||||||
{
|
{
|
||||||
pthread_mutex_lock(&(event_queue->mutex));
|
pthread_mutex_lock(&(event_queue->mutex));
|
||||||
@ -116,6 +126,9 @@ xfEvent* xf_event_pop(xfEventQueue* event_queue)
|
|||||||
if (event_queue->count < 1)
|
if (event_queue->count < 1)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
/* remove event signal */
|
||||||
|
xf_clear_event(event_queue);
|
||||||
|
|
||||||
event = event_queue->events[0];
|
event = event_queue->events[0];
|
||||||
(event_queue->count)--;
|
(event_queue->count)--;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user