Browse Source

Compilation on WIN32

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@1351 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/0.61
sletz 17 years ago
parent
commit
3374ce1d4b
3 changed files with 10 additions and 8 deletions
  1. +1
    -1
      common/JackAPI.cpp
  2. +6
    -6
      windows/JackWinThread.cpp
  3. +3
    -1
      windows/JackWinThread.h

+ 1
- 1
common/JackAPI.cpp View File

@@ -1099,7 +1099,7 @@ EXPORT int jack_client_create_thread(jack_client_t* client,
#ifdef __APPLE__
return JackPosixThread::StartImp(thread, priority, realtime, start_routine, arg);
#elif WIN32
return JackWinThread::StartImp(thread, priority, realtime, start_routine, arg);
return JackWinThread::StartImp(thread, priority, realtime, (ThreadCallback)start_routine, arg);
#else
return JackPosixThread::StartImp(thread, priority, realtime, start_routine, arg);
#endif


+ 6
- 6
windows/JackWinThread.cpp View File

@@ -87,7 +87,7 @@ int JackWinThread::Start()
}
}

int JackWinThread::StartImp(pthread_t* thread, int priority, int realtime, void*(*start_routine)(void*), void* arg);
int JackWinThread::StartImp(pthread_t* thread, int priority, int realtime, ThreadCallback start_routine, void* arg)
{
DWORD id;

@@ -113,7 +113,7 @@ int JackWinThread::StartImp(pthread_t* thread, int priority, int realtime, void*
JackLog("Create non RT thread\n");
*thread = CreateThread(NULL, 0, start_routine, arg, 0, &id);

if (fThread == NULL) {
if (thread == NULL) {
jack_error("Cannot create thread error = %d", GetLastError());
return -1;
}
@@ -261,17 +261,17 @@ int JackWinThread::DropRealTime()
*/
int JackWinThread::DropRealTime()
{
return DropRealTime(fThread);
return DropRealTimeImp(fThread);
}

int JackWinThread::DropRealTime(pthread_t thread)
int JackWinThread::DropRealTimeImp(pthread_t thread)
{
if (SetThreadPriority(thread, THREAD_PRIORITY_NORMAL)) {
return 0;
} else {
jack_error("Cannot set thread priority = %d", GetLastError());
return -1;
}
return -1;
}
}

pthread_t JackWinThread::GetThreadID()


+ 3
- 1
windows/JackWinThread.h View File

@@ -27,6 +27,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

namespace Jack
{
typedef DWORD (WINAPI *ThreadCallback)(void *arg);

/*!
\brief Windows threads.
@@ -60,7 +62,7 @@ class JackWinThread : public JackThread
static int AcquireRealTimeImp(pthread_t thread, int priority);
static int DropRealTimeImp(pthread_t thread);
static int StartImp(pthread_t* thread, int priority, int realtime, void*(*start_routine)(void*), void* arg);
static int StartImp(pthread_t* thread, int priority, int realtime, ThreadCallback start_routine, void* arg);

};



Loading…
Cancel
Save