X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;ds=sidebyside;f=src%2Fyaz-pdu-assoc-thread.cpp;h=e526dfc224b22d14d741a71e19b26fc37eec17f2;hb=4c758111f1ff5a815888f70a4c4335ab149f5608;hp=d59846cda7c84956096038c138e62ab85d74fa64;hpb=c96f00d22f0af97ad7fd5d8687fa0b65b67de77e;p=yazpp-moved-to-github.git diff --git a/src/yaz-pdu-assoc-thread.cpp b/src/yaz-pdu-assoc-thread.cpp index d59846c..e526dfc 100644 --- a/src/yaz-pdu-assoc-thread.cpp +++ b/src/yaz-pdu-assoc-thread.cpp @@ -2,34 +2,32 @@ * Copyright (c) 1998-2001, Index Data. * See the file LICENSE for details. * - * $Log: yaz-pdu-assoc-thread.cpp,v $ - * Revision 1.3 2001-08-13 16:39:12 adam - * PDU_Assoc keeps track of children. Using yaz_log instead of logf. - * - * Revision 1.2 2001/03/27 14:47:45 adam - * New server facility scheme. - * - * Revision 1.1 2001/03/26 14:43:49 adam - * New threaded PDU association. - * + * $Id: yaz-pdu-assoc-thread.cpp,v 1.7 2004-11-30 21:10:31 adam Exp $ */ #ifdef WIN32 +#define USE_THREADS 1 +#endif + +#if YAZ_POSIX_THREADS +#define USE_THREADS 1 +#endif + +#if USE_THREADS + +#ifdef WIN32 #include #else #include #include #endif - #include -#include +#include #include -#include -#include - - +#include +#include Yaz_PDU_AssocThread::Yaz_PDU_AssocThread( IYazSocketObservable *socketObservable) @@ -47,10 +45,10 @@ events(void *p) { Yaz_SocketManager *s = (Yaz_SocketManager *) p; - yaz_log (LOG_LOG, "thread started"); + yaz_log (YLOG_LOG, "thread started"); while (s->processEvent() > 0) ; - yaz_log (LOG_LOG, "thread finished"); + yaz_log (YLOG_LOG, "thread finished"); #ifdef WIN32 #else return 0; @@ -74,7 +72,7 @@ void Yaz_PDU_AssocThread::childNotify(COMSTACK cs) t_id = _beginthread (events, 0, socket_observable); if (t_id == -1) { - yaz_log (LOG_FATAL|LOG_ERRNO, "_beginthread failed"); + yaz_log (YLOG_FATAL|YLOG_ERRNO, "_beginthread failed"); exit (1); } #else @@ -82,8 +80,9 @@ void Yaz_PDU_AssocThread::childNotify(COMSTACK cs) int id = pthread_create (&tid, 0, events, socket_observable); if (id) - yaz_log (LOG_ERRNO|LOG_FATAL, "pthread_create returned id=%d", id); + yaz_log (YLOG_ERRNO|YLOG_FATAL, "pthread_create returned id=%d", id); else pthread_detach (tid); #endif } +#endif