00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "JackGlobals.h"
00021
00022 namespace Jack
00023 {
00024
00025 bool JackGlobals::fVerbose = 0;
00026
00027 jack_tls_key JackGlobals::fRealTime;
00028 static bool gKeyRealtimeInitialized = jack_tls_allocate_key(&JackGlobals::fRealTime);
00029
00030 jack_tls_key JackGlobals::fKeyLogFunction;
00031 static bool fKeyLogFunctionInitialized = jack_tls_allocate_key(&JackGlobals::fKeyLogFunction);
00032
00033 JackMutex* JackGlobals::fOpenMutex = new JackMutex();
00034 bool JackGlobals::fServerRunning = false;
00035 JackClient* JackGlobals::fClientTable[CLIENT_NUM] = {};
00036
00037 #ifndef WIN32
00038 jack_thread_creator_t JackGlobals::fJackThreadCreator = pthread_create;
00039 #endif
00040
00041 #ifdef __CLIENTDEBUG__
00042 std::ofstream* JackGlobals::fStream = NULL;
00043
00044 void JackGlobals::CheckContext(const char* name)
00045 {
00046 if (JackGlobals::fStream == NULL) {
00047 char provstr[256];
00048 char buffer[256];
00049 time_t curtime;
00050 struct tm *loctime;
00051
00052 curtime = time (NULL);
00053
00054 loctime = localtime (&curtime);
00055 strftime (buffer, 256, "%I-%M", loctime);
00056 sprintf(provstr, "JackAPICall-%s.log", buffer);
00057 JackGlobals::fStream = new std::ofstream(provstr, std::ios_base::ate);
00058 JackGlobals::fStream->is_open();
00059 }
00060 (*fStream) << "JACK API call : " << name << ", calling thread : " << pthread_self() << std::endl;
00061 }
00062 #endif
00063
00064 }