ui/common/message.h

changeset 953
c98404829cd3
parent 944
cc23aad6335e
child 981
1d47e71f26b6
equal deleted inserted replaced
952:f55630d3006f 953:c98404829cd3
27 */ 27 */
28 28
29 #ifndef UIC_MESSAGE_H 29 #ifndef UIC_MESSAGE_H
30 #define UIC_MESSAGE_H 30 #define UIC_MESSAGE_H
31 31
32
32 #include <cx/string.h> 33 #include <cx/string.h>
33 #include <cx/json.h> 34 #include <cx/json.h>
34 #include <cx/buffer.h> 35 #include <cx/buffer.h>
35 36
37 #ifndef _WIN32
36 #include <pthread.h> 38 #include <pthread.h>
39 #endif
37 40
38 41
39 #ifdef __cplusplus 42 #ifdef __cplusplus
40 extern "C" { 43 extern "C" {
41 #endif 44 #endif
55 58
56 typedef struct UiSimpleMessageHandler { 59 typedef struct UiSimpleMessageHandler {
57 UiMessageHandler handler; 60 UiMessageHandler handler;
58 int in; 61 int in;
59 int out; 62 int out;
63 #ifndef _WIN32
60 pthread_t in_thread; 64 pthread_t in_thread;
61 pthread_t out_thread; 65 pthread_t out_thread;
62 pthread_mutex_t queue_lock; 66 pthread_mutex_t queue_lock;
63 pthread_mutex_t avlbl_lock; 67 pthread_mutex_t avlbl_lock;
64 pthread_cond_t available; 68 pthread_cond_t available;
69 #endif
65 CxBuffer *outbuf; 70 CxBuffer *outbuf;
66 int stop; 71 int stop;
67 } UiSimpleMessageHandler; 72 } UiSimpleMessageHandler;
68 73
69 UiMessageHandler* uic_simple_msg_handler(int in, int out, msg_received_callback callback); 74 UiMessageHandler* uic_simple_msg_handler(int in, int out, msg_received_callback callback);

mercurial