2 Copyright (C) 2001 Paul Davis
3 Copyright (C) 2004-2006 Grame
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #ifndef __JackWinThread__
23 #define __JackWinThread__
25 #include "JackThread.h"
26 #include "JackCompilerDeps.h"
27 #include "JackSystemDeps.h"
33 typedef DWORD (WINAPI
*ThreadCallback
)(void *arg
);
36 \brief Windows threads.
39 class SERVER_EXPORT JackWinThread
: public detail::JackThreadInterface
47 static DWORD WINAPI
ThreadHandler(void* arg
);
51 JackWinThread(JackRunnableInterface
* runnable
);
60 int AcquireRealTime();
61 int AcquireRealTime(int priority
) ;
64 pthread_t
GetThreadID();
66 static int AcquireRealTimeImp(pthread_t thread
, int priority
);
67 static int AcquireRealTimeImp(pthread_t thread
, int priority
, UInt64 period
, UInt64 computation
, UInt64 constraint
)
69 return JackWinThread::AcquireRealTimeImp(thread
, priority
);
71 static int DropRealTimeImp(pthread_t thread
);
72 static int StartImp(pthread_t
* thread
, int priority
, int realtime
, void*(*start_routine
)(void*), void* arg
)
74 return JackWinThread::StartImp(thread
, priority
, realtime
, (ThreadCallback
) start_routine
, arg
);
76 static int StartImp(pthread_t
* thread
, int priority
, int realtime
, ThreadCallback start_routine
, void* arg
);
77 static int StopImp(pthread_t thread
);
78 static int KillImp(pthread_t thread
);
82 SERVER_EXPORT
void ThreadExit();