14 #ifndef T3_WIDGET_KEYBUFFER_H
15 #define T3_WIDGET_KEYBUFFER_H
17 #ifndef _T3_WIDGET_INTERNAL
18 #error This header file is for internal use _only_!!
28 #include <t3widget/key.h>
45 pthread_mutex_init(&lock, NULL);
46 pthread_cond_init(&cond, NULL);
51 pthread_mutex_lock(&lock);
56 items.push_back(item);
59 pthread_cond_signal(&cond);
60 pthread_mutex_unlock(&lock);
66 pthread_mutex_lock(&lock);
68 pthread_cond_wait(&cond, &lock);
69 result = items.front();
71 pthread_mutex_unlock(&lock);
77 pthread_mutex_destroy(&lock);
78 pthread_cond_destroy(&cond);
87 pthread_mutex_lock(&lock);
90 if (find(items.begin(), items.end(), key) != items.end()) {
91 pthread_mutex_unlock(&lock);
102 pthread_cond_signal(&cond);
103 pthread_mutex_unlock(&lock);
107 typedef item_buffer_t<mouse_event_t> mouse_event_buffer_t;