Use cbuf for control event queue

Replace the control_event_queue implementation by cbuf.
This commit is contained in:
Romain Vimont
2019-05-29 21:24:30 +02:00
parent b38292cd69
commit 241a3dcba5
6 changed files with 14 additions and 190 deletions

View File

@@ -1,14 +1,16 @@
#ifndef CONTROL_H
#define CONTROL_H
#include "control_event.h"
#include <stdbool.h>
#include <SDL2/SDL_mutex.h>
#include <SDL2/SDL_thread.h>
#include "cbuf.h"
#include "control_event.h"
#include "net.h"
struct control_event_queue CBUF(struct control_event, 64);
struct controller {
socket_t video_socket;
SDL_Thread *thread;
@@ -33,7 +35,6 @@ controller_stop(struct controller *controller);
void
controller_join(struct controller *controller);
// expose simple API to hide control_event_queue
bool
controller_push_event(struct controller *controller,
const struct control_event *event);