In JackCoreAudioDriver, improve management of input/output channels: -1 is now used...
[jack2.git] / windows / JackWinThread.h
blob11ab8af5dc8f4cfe16f93bb664735befcabecb3c
1 /*
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"
28 #include <windows.h>
30 namespace Jack
33 typedef DWORD (WINAPI *ThreadCallback)(void *arg);
35 /*!
36 \brief Windows threads.
39 class SERVER_EXPORT JackWinThread : public detail::JackThreadInterface
42 private:
44 HANDLE fThread;
45 HANDLE fEvent;
47 static DWORD WINAPI ThreadHandler(void* arg);
49 public:
51 JackWinThread(JackRunnableInterface* runnable);
52 ~JackWinThread();
54 int Start();
55 int StartSync();
56 int Kill();
57 int Stop();
58 void Terminate();
60 int AcquireRealTime();
61 int AcquireRealTime(int priority) ;
62 int DropRealTime();
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();
84 } // end of namespace
86 #endif