1 /* $Id: msg-thread.h,v 1.5 2005-08-15 12:51:57 adam Exp $
2 Copyright (c) 1998-2005, Index Data.
4 This file is part of the yaz-proxy.
6 YAZ proxy is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 2, or (at your option) any later
11 YAZ proxy is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 You should have received a copy of the GNU General Public License
17 along with YAZ proxy; see the file LICENSE. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
30 #include <yaz++/socket-observer.h>
31 #include <yaz/yconfig.h>
35 virtual IMsg_Thread *handle() = 0;
36 virtual void result() = 0;
39 class Msg_Thread_Queue_List {
40 friend class Msg_Thread_Queue;
43 Msg_Thread_Queue_List *m_next;
46 class Msg_Thread_Queue {
49 void enqueue(IMsg_Thread *in);
50 IMsg_Thread *dequeue();
53 Msg_Thread_Queue_List *m_list;
56 class Msg_Thread : public yazpp_1::ISocketObserver {
58 Msg_Thread(yazpp_1::ISocketObservable *obs);
59 virtual ~Msg_Thread();
60 void socketNotify(int event);
61 void put(IMsg_Thread *m);
66 yazpp_1::ISocketObservable *m_SocketObservable;
67 pthread_t m_thread_id;
68 Msg_Thread_Queue m_input;
69 Msg_Thread_Queue m_output;
70 pthread_mutex_t m_mutex_input_data;
71 pthread_cond_t m_cond_input_data;
72 pthread_mutex_t m_mutex_output_data;
79 * indent-tabs-mode: nil
81 * vim: shiftwidth=4 tabstop=8 expandtab