00001 // Copyright (C) 2001, Compaq Computer Corporation 00002 // 00003 // This file is part of Vesta. 00004 // 00005 // Vesta is free software; you can redistribute it and/or 00006 // modify it under the terms of the GNU Lesser General Public 00007 // License as published by the Free Software Foundation; either 00008 // version 2.1 of the License, or (at your option) any later version. 00009 // 00010 // Vesta is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 // Lesser General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU Lesser General Public 00016 // License along with Vesta; if not, write to the Free Software 00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 00019 // Last modified on Mon May 23 22:09:36 EDT 2005 by ken@xorian.net 00020 // modified on Tue Jan 21 13:45:00 PST 1997 by heydon 00021 00022 // system includes 00023 #include <unistd.h> 00024 #include <sys/param.h> 00025 00026 // basics 00027 #include <Basics.H> 00028 00029 // cache-common 00030 #include <CacheConfig.H> 00031 00032 // local includes 00033 #include "ParCacheC.H" 00034 00035 Basics::mutex mu; // protects serverHost 00036 static Text *serverHost = (Text *)NULL; 00037 00038 Text *ParCacheC::Locate() throw () 00039 { 00040 Text *res; 00041 mu.lock(); 00042 res = (serverHost == (Text *)NULL) 00043 ? NEW_CONSTR(Text, (Config_Host)) 00044 : serverHost; 00045 mu.unlock(); 00046 return res; 00047 } 00048 00049 void ParCacheC::SetServerHost(char *name) throw () 00050 { 00051 mu.lock(); 00052 if (name == (char *)NULL) { 00053 serverHost = (Text *)NULL; 00054 } else { 00055 serverHost = NEW_CONSTR(Text, (name)); 00056 } 00057 mu.unlock(); 00058 }