JackWinThread.h

00001 /*
00002 Copyright (C) 2001 Paul Davis 
00003 Copyright (C) 2004-2006 Grame
00004 
00005 This program is free software; you can redistribute it and/or modify
00006 it under the terms of the GNU General Public License as published by
00007 the Free Software Foundation; either version 2 of the License, or
00008 (at your option) any later version.
00009 
00010 This program is distributed in the hope that it will be useful,
00011 but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 GNU General Public License for more details.
00014 
00015 You should have received a copy of the GNU General Public License
00016 along with this program; if not, write to the Free Software
00017 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018 
00019 */
00020 
00021 
00022 #ifndef __JackWinThread__
00023 #define __JackWinThread__
00024 
00025 #include "JackThread.h"
00026 #include <windows.h>
00027 
00028 namespace Jack
00029 {
00030 
00031 typedef DWORD  (WINAPI *ThreadCallback)(void *arg);
00032 
00037 class JackWinThread : public JackThread
00038 {
00039 
00040     private:
00041 
00042         HANDLE fThread;
00043         HANDLE fEvent;
00044 
00045         static DWORD WINAPI ThreadHandler(void* arg);
00046 
00047     public:
00048 
00049         JackWinThread(JackRunnableInterface* runnable);
00050         virtual ~JackWinThread();
00051    
00052         int Start();
00053         int StartSync();
00054         int Kill();
00055         int Stop();
00056                 void Terminate();
00057 
00058         int AcquireRealTime();
00059         int AcquireRealTime(int priority) ;
00060         int DropRealTime();
00061 
00062         pthread_t GetThreadID();
00063                 
00064                 static int AcquireRealTimeImp(pthread_t thread, int priority);
00065                 static int DropRealTimeImp(pthread_t thread);
00066                 static int StartImp(pthread_t* thread, int priority, int realtime, ThreadCallback start_routine, void* arg);
00067 
00068 };
00069 
00070 } // end of namespace
00071 
00072 #endif

Generated on Thu Feb 14 11:16:02 2008 for Jackdmp by  doxygen 1.5.1