Mixe for Privacy and Anonymity in the Internet
Go to the documentation of this file.
00001 /*
00002 Copyright (c) 2000, The JAP-Team
00004 Redistribution and use in source and binary forms, with or without modification,
00005 are permitted provided that the following conditions are met:
00006
00007   - Redistributions of source code must retain the above copyright notice,
00008     this list of conditions and the following disclaimer.
00009
00010   - Redistributions in binary form must reproduce the above copyright notice,
00011     this list of conditions and the following disclaimer in the documentation and/or
00012     other materials provided with the distribution.
00013
00014   - Neither the name of the University of Technology Dresden, Germany nor the names of its contributors
00015     may be used to endorse or promote products derived from this software without specific
00016     prior written permission.
00017
00018
00019 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS'' AND ANY EXPRESS
00020 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
00021 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS
00022 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00023 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
00024 OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
00025 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00026 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
00027 */
00028 #include "StdAfx.h"
00029 #ifndef ONLY_LOCAL_PROXY
00031 #include "CAUtil.hpp"
00032 #include "CAMsg.hpp"
00033 #ifdef _DEBUG
00035 #endif
00036
00037 #ifdef OS_TUDOS
00039 #endif
00040
00044   const char* CAThread::METHOD_BEGIN = "Begin of method";
00045   const char* CAThread::METHOD_END = "End of method";
00046 #endif
00047
00048 #if defined (DEBUG) && ! defined(ONLY_LOCAL_PROXY)
00050 #endif
00051
00053
00055   {
00056     m_fncMainLoop=NULL;
00057 #ifdef OS_TUDOS
00062 #else
00064 #endif
00065     m_strName=NULL;
00066     m_Id=ms_LastId;
00067     ms_LastId++;
00068   }
00069
00071   {
00072     m_fncMainLoop=NULL;
00073 #ifdef OS_TUDOS
00075 #else
00077 #endif
00078     m_strName=NULL;
00079     if(strName!=NULL)
00080       {
00081         UINT32 len=strlen((char*)strName);
00082         m_strName=new UINT8[len+1];
00083         memcpy(m_strName,strName,len);
00084         m_strName[len]=0;
00085       }
00086     m_Id=ms_LastId;
00087     ms_LastId++;
00088   }
00091 {
00092   delete a_value;
00093   a_value = NULL;
00094 }
00095
00097 {
00099 }
00100
00102 {
00105
00106   delete value;
00107   value = a_value;
00109 }
00110
00112 {
00115 }
00116 #endif
00117
00118 SINT32 CAThread::start(void* param,bool bDaemon,bool bSilent)
00119   {
00120     if(m_fncMainLoop==NULL)
00121       return E_UNKNOWN;
00122
00123 #ifndef OS_TUDOS
00125 #endif
00126
00127     #ifdef DEBUG
00128       if(!bSilent)
00130     #endif
00131
00132 #ifdef OS_TUDOS
00134       {
00136         if(!bSilent)
00138         return E_UNKNOWN;
00139       }
00140 #else
00142     if(ret!=0)
00143       {
00144         if(!bSilent)
00148         return E_UNKNOWN;
00149       }
00150     #endif
00151 #ifdef _DEBUG
00153     {
00155     }
00156
00157     else
00158     {
00160     }
00161 #endif
00162 #ifdef DEBUG
00163     if(!bSilent)
00165 #endif
00166
00167     #ifdef OS_TUDOS
00168
00169     if(m_strName!=NULL&&!bSilent)
00170       CAMsg::printMsg(LOG_DEBUG,
00173
00174     if(bDaemon)
00175       CAMsg::printMsg(LOG_ERR, "TODO: Emulate pthread_detach on L4 ?!\n");
00176     #else
00177     if(m_strName!=NULL&&!bSilent)
00178       {
00181         delete[] temp;
00182         temp = NULL;
00183       }
00184     if(bDaemon)
00186 #endif
00187     return E_SUCCESS;
00188   }
00189
00191 {
00192 #ifdef OS_TUDOS
00193   CAMsg::printMsg(LOG_ERR,"CAThread - join() L4 implement me !\n");
00195     return E_SUCCESS;
00196
00197   return E_UNKNOWN;
00198 #else
00200     return E_SUCCESS;
00202   if(ret==0)
00203   {
00204 #ifdef DEBUG
00205       CAMsg::printMsg(LOG_DEBUG,"CAThread %s - join() successful\n", m_strName);
00207 #endif
00208