X-Git-Url: http://git.indexdata.com/?p=yazproxy-moved-to-github.git;a=blobdiff_plain;f=src%2Fmsg-thread.h;h=4cca1833d3ecc62512997322ce0dc50ee07a0f16;hp=56722d690670e110eedb43aa02d7d8642eb43412;hb=7fa984c171c65d05d34775c4533808793b2109cb;hpb=4e7b65539b3bea310f8d626d42e64cfd9e054dd5 diff --git a/src/msg-thread.h b/src/msg-thread.h index 56722d6..4cca183 100644 --- a/src/msg-thread.h +++ b/src/msg-thread.h @@ -1,7 +1,5 @@ -/* $Id: msg-thread.h,v 1.5 2005-08-15 12:51:57 adam Exp $ - Copyright (c) 1998-2005, Index Data. - -This file is part of the yaz-proxy. +/* This file is part of YAZ proxy + Copyright (C) 1998-2009 Index Data YAZ proxy is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -14,36 +12,28 @@ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with YAZ proxy; see the file LICENSE. If not, write to the -Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. - */ - -#include -#include -#include - -#if HAVE_DLFCN_H -#include -#endif +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ -#include +#include #include -class IMsg_Thread { +class YAZ_EXPORT IMsg_Thread { public: virtual IMsg_Thread *handle() = 0; virtual void result() = 0; + virtual ~IMsg_Thread(); }; -class Msg_Thread_Queue_List { +class YAZ_EXPORT Msg_Thread_Queue_List { friend class Msg_Thread_Queue; private: IMsg_Thread *m_item; Msg_Thread_Queue_List *m_next; }; -class Msg_Thread_Queue { +class YAZ_EXPORT Msg_Thread_Queue { public: Msg_Thread_Queue(); void enqueue(IMsg_Thread *in); @@ -53,29 +43,23 @@ class Msg_Thread_Queue { Msg_Thread_Queue_List *m_list; }; -class Msg_Thread : public yazpp_1::ISocketObserver { +class YAZ_EXPORT Msg_Thread : public yazpp_1::ISocketObserver { + class Private; public: - Msg_Thread(yazpp_1::ISocketObservable *obs); + Msg_Thread(yazpp_1::ISocketObservable *obs, int no_threads); virtual ~Msg_Thread(); void socketNotify(int event); void put(IMsg_Thread *m); IMsg_Thread *get(); void run(void *p); - int m_fd[2]; private: - yazpp_1::ISocketObservable *m_SocketObservable; - pthread_t m_thread_id; - Msg_Thread_Queue m_input; - Msg_Thread_Queue m_output; - pthread_mutex_t m_mutex_input_data; - pthread_cond_t m_cond_input_data; - pthread_mutex_t m_mutex_output_data; - bool m_stop_flag; + class Private *m_p; }; /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab