git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4638 0c269be4-1314-0410-8aa9-9f06e86f4224tags/1.9.8
| @@ -81,7 +81,7 @@ JackEngineProfiling::~JackEngineProfiling() | |||
| fStream << ((d7 > 0 && d6 > 0) ? (d7 - d6) : 0) << "\t" ; | |||
| fStream << fProfileTable[i].fClientTable[ref].fStatus << "\t" ;; | |||
| } else { // Print tabs | |||
| } else { // Print tabs | |||
| fStream << "\t \t \t \t \t \t \t"; | |||
| } | |||
| } | |||
| @@ -136,7 +136,7 @@ JackEngineProfiling::~JackEngineProfiling() | |||
| fStream2 << "set xlabel \"audio cycles\"\n"; | |||
| fStream2 << "set ylabel \"usec\"\n"; | |||
| fStream2 << "plot \"JackEngineProfiling.log\" using 2 title \"Driver end date\" with lines \n"; | |||
| fStream2 << "unset output\n"; | |||
| fStream2 << "unset output\n"; | |||
| } | |||
| // Clients end date | |||
| @@ -198,8 +198,8 @@ JackEngineProfiling::~JackEngineProfiling() | |||
| fStream3 << "\"JackEngineProfiling.log\" using " << ((i + 1) * 7) - 1 << " title \"" << fIntervalTable[i].fName << "\" with lines,"; | |||
| } | |||
| } | |||
| fStream3 << "\nunset multiplot\n"; | |||
| fStream3 << "unset output\n"; | |||
| fStream3 << "\nunset multiplot\n"; | |||
| fStream3 << "unset output\n"; | |||
| } | |||
| } | |||
| @@ -242,8 +242,8 @@ JackEngineProfiling::~JackEngineProfiling() | |||
| fStream4 << "\"JackEngineProfiling.log\" using " << ((i + 1) * 7) << " title \"" << fIntervalTable[i].fName << "\" with lines,"; | |||
| } | |||
| } | |||
| fStream4 << "\nunset multiplot\n"; | |||
| fStream4 << "unset output\n"; | |||
| fStream4 << "\nunset multiplot\n"; | |||
| fStream4 << "unset output\n"; | |||
| } | |||
| } | |||
| @@ -286,8 +286,8 @@ JackEngineProfiling::~JackEngineProfiling() | |||
| fStream5 << "\"JackEngineProfiling.log\" using " << ((i + 1) * 7) + 1 << " title \"" << fIntervalTable[i].fName << "\" with lines,"; | |||
| } | |||
| } | |||
| fStream5 << "\nunset multiplot\n"; | |||
| fStream5 << "unset output\n"; | |||
| fStream5 << "\nunset multiplot\n"; | |||
| fStream5 << "unset output\n"; | |||
| } | |||
| } | |||
| @@ -40,8 +40,9 @@ bool JackMachSemaphore::Signal() | |||
| return false; | |||
| } | |||
| if (fFlush) | |||
| if (fFlush) { | |||
| return true; | |||
| } | |||
| kern_return_t res; | |||
| if ((res = semaphore_signal(fSemaphore)) != KERN_SUCCESS) { | |||
| @@ -57,8 +58,9 @@ bool JackMachSemaphore::SignalAll() | |||
| return false; | |||
| } | |||
| if (fFlush) | |||
| if (fFlush) { | |||
| return true; | |||
| } | |||
| kern_return_t res; | |||
| // When signaled several times, do not accumulate signals... | |||
| @@ -150,14 +152,6 @@ bool JackMachSemaphore::ConnectInput(const char* name, const char* server_name) | |||
| BuildName(name, server_name, fName, sizeof(fName)); | |||
| kern_return_t res; | |||
| // Temporary... A REVOIR | |||
| /* | |||
| if (fSemaphore > 0) { | |||
| jack_log("Already connected name = %s", name); | |||
| return true; | |||
| } | |||
| */ | |||
| if (fBootPort == 0) { | |||
| if ((res = task_get_bootstrap_port(mach_task_self(), &fBootPort)) != KERN_SUCCESS) { | |||
| jack_error("Connect: can't find bootstrap port err = %s", mach_error_string(res)); | |||
| @@ -27,9 +27,9 @@ | |||
| #include <stdint.h> | |||
| #endif | |||
| namespace Jack | |||
| { | |||
| #define E(code, s) { code, s } | |||
| #define NET_ERROR_CODE WSAGetLastError() | |||
| #define StrError PrintError | |||
| @@ -24,27 +24,27 @@ | |||
| inline bool CHECK_MLOCK(void* ptr, size_t size) | |||
| { | |||
| if (!VirtualLock((ptr), (size))) { | |||
| if (!VirtualLock((ptr), (size))) { | |||
| SIZE_T minWSS, maxWSS; | |||
| HANDLE hProc = GetCurrentProcess(); | |||
| if (GetProcessWorkingSetSize(hProc, &minWSS, &maxWSS)) { | |||
| if (GetProcessWorkingSetSize(hProc, &minWSS, &maxWSS)) { | |||
| const size_t increase = size + (10 * 4096); | |||
| maxWSS += increase; | |||
| maxWSS += increase; | |||
| minWSS += increase; | |||
| if (!SetProcessWorkingSetSize(hProc, minWSS, maxWSS)) { | |||
| jack_error("SetProcessWorkingSetSize error = %d", GetLastError()); | |||
| jack_error("SetProcessWorkingSetSize error = %d", GetLastError()); | |||
| return false; | |||
| } else if (!VirtualLock((ptr), (size))) { | |||
| jack_error("VirtualLock error = %d", GetLastError()); | |||
| jack_error("VirtualLock error = %d", GetLastError()); | |||
| return false; | |||
| } else { | |||
| } else { | |||
| return true; | |||
| } | |||
| } else { | |||
| return false; | |||
| } else { | |||
| return false; | |||
| } | |||
| } else { | |||
| return true; | |||
| } else { | |||
| return true; | |||
| } | |||
| } | |||
| @@ -53,3 +53,4 @@ inline bool CHECK_MLOCK(void* ptr, size_t size) | |||
| #define CHECK_MUNLOCKALL()(false) | |||
| #endif | |||
| @@ -370,52 +370,6 @@ int JackWinAsyncNamedPipeServer::Bind(const char* dir, const char* name, int whi | |||
| return BindAux(); | |||
| } | |||
| /* | |||
| int JackWinAsyncNamedPipeServer::Bind(const char* dir, int which) | |||
| { | |||
| snprintf(fName, sizeof(fName), "\\\\.\\pipe\\%s_jack_%d", dir, which); | |||
| jack_log("Bind: fName %s", fName); | |||
| if ((fNamedPipe = CreateNamedPipe(fName, | |||
| PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, // read/write access | |||
| PIPE_TYPE_MESSAGE | // message type pipe | |||
| PIPE_READMODE_MESSAGE | // message-read mode | |||
| PIPE_WAIT, // blocking mode | |||
| PIPE_UNLIMITED_INSTANCES, // max. instances | |||
| BUFSIZE, // output buffer size | |||
| BUFSIZE, // input buffer size | |||
| INFINITE, // client time-out | |||
| NULL)) == INVALID_HANDLE_VALUE) { // no security a | |||
| jack_error("Cannot bind server to pipe err = %ld", GetLastError()); | |||
| return -1; | |||
| } else { | |||
| return 0; | |||
| } | |||
| } | |||
| int JackWinAsyncNamedPipeServer::Bind(const char* dir, const char* name, int which) | |||
| { | |||
| snprintf(fName, sizeof(fName), "\\\\.\\pipe\\%s_jack_%s_%d", dir, name, which); | |||
| jack_log("Bind: fName %s", fName); | |||
| if ((fNamedPipe = CreateNamedPipe(fName, | |||
| PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, // read/write access | |||
| PIPE_TYPE_MESSAGE | // message type pipe | |||
| PIPE_READMODE_MESSAGE | // message-read mode | |||
| PIPE_WAIT, // blocking mode | |||
| PIPE_UNLIMITED_INSTANCES, // max. instances | |||
| BUFSIZE, // output buffer size | |||
| BUFSIZE, // input buffer size | |||
| INFINITE, // client time-out | |||
| NULL)) == INVALID_HANDLE_VALUE) { // no security a | |||
| jack_error("Cannot bind server to pipe err = %ld", GetLastError()); | |||
| return -1; | |||
| } else { | |||
| return 0; | |||
| } | |||
| } | |||
| */ | |||
| bool JackWinAsyncNamedPipeServer::Accept() | |||
| { | |||
| return false; | |||
| @@ -38,8 +38,9 @@ bool JackWinSemaphore::Signal() | |||
| BOOL res; | |||
| assert(fSemaphore); | |||
| if (fFlush) | |||
| if (fFlush) { | |||
| return true; | |||
| } | |||
| if (!(res = ReleaseSemaphore(fSemaphore, 1, NULL))) { | |||
| jack_error("JackWinSemaphore::Signal name = %s err = %ld", fName, GetLastError()); | |||
| @@ -53,8 +54,9 @@ bool JackWinSemaphore::SignalAll() | |||
| BOOL res; | |||
| assert(fSemaphore); | |||
| if (fFlush) | |||
| if (fFlush) { | |||
| return true; | |||
| } | |||
| if (!(res = ReleaseSemaphore(fSemaphore, 1, NULL))) { | |||
| jack_error("JackWinSemaphore::SignalAll name = %s err = %ld", fName, GetLastError()); | |||