Browse Source

Compile on Windows again.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4145 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/1.9.7
sletz 14 years ago
parent
commit
ab32fa70f0
9 changed files with 153 additions and 153 deletions
  1. +18
    -18
      common/JackAPI.cpp
  2. +1
    -1
      common/JackClient.cpp
  3. +1
    -1
      common/JackClient.h
  4. +2
    -2
      common/JackDebugClient.h
  5. +3
    -3
      common/JackNetManager.h
  6. +28
    -28
      common/JackThread.h
  7. +70
    -70
      common/jack/jack.h
  8. +22
    -22
      windows/JackWinThread.cpp
  9. +8
    -8
      windows/JackWinThread.h

+ 18
- 18
common/JackAPI.cpp View File

@@ -179,7 +179,7 @@ extern "C"
EXPORT jack_nframes_t jack_frame_time (const jack_client_t *); EXPORT jack_nframes_t jack_frame_time (const jack_client_t *);
EXPORT jack_nframes_t jack_last_frame_time (const jack_client_t *client); EXPORT jack_nframes_t jack_last_frame_time (const jack_client_t *client);
EXPORT float jack_cpu_load (jack_client_t *client); EXPORT float jack_cpu_load (jack_client_t *client);
EXPORT pthread_t jack_client_thread_id (jack_client_t *);
EXPORT jack_native_thread_t jack_client_thread_id (jack_client_t *);
EXPORT void jack_set_error_function (print_function); EXPORT void jack_set_error_function (print_function);
EXPORT void jack_set_info_function (print_function); EXPORT void jack_set_info_function (print_function);


@@ -213,17 +213,17 @@ extern "C"


EXPORT int jack_client_real_time_priority (jack_client_t*); EXPORT int jack_client_real_time_priority (jack_client_t*);
EXPORT int jack_client_max_real_time_priority (jack_client_t*); EXPORT int jack_client_max_real_time_priority (jack_client_t*);
EXPORT int jack_acquire_real_time_scheduling (pthread_t thread, int priority);
EXPORT int jack_acquire_real_time_scheduling (jack_native_thread_t thread, int priority);
EXPORT int jack_client_create_thread (jack_client_t* client, EXPORT int jack_client_create_thread (jack_client_t* client,
pthread_t *thread,
jack_native_thread_t *thread,
int priority, int priority,
int realtime, // boolean int realtime, // boolean
thread_routine routine, thread_routine routine,
void *arg); void *arg);
EXPORT int jack_drop_real_time_scheduling (pthread_t thread);
EXPORT int jack_drop_real_time_scheduling (jack_native_thread_t thread);


EXPORT int jack_client_stop_thread (jack_client_t* client, pthread_t thread);
EXPORT int jack_client_kill_thread (jack_client_t* client, pthread_t thread);
EXPORT int jack_client_stop_thread (jack_client_t* client, jack_native_thread_t thread);
EXPORT int jack_client_kill_thread (jack_client_t* client, jack_native_thread_t thread);
#ifndef WIN32 #ifndef WIN32
EXPORT void jack_set_thread_creator (jack_thread_creator_t jtc); EXPORT void jack_set_thread_creator (jack_thread_creator_t jtc);
#endif #endif
@@ -1396,7 +1396,7 @@ EXPORT float jack_cpu_load(jack_client_t* ext_client)
} }
} }


EXPORT pthread_t jack_client_thread_id(jack_client_t* ext_client)
EXPORT jack_native_thread_t jack_client_thread_id(jack_client_t* ext_client)
{ {
#ifdef __CLIENTDEBUG__ #ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_client_thread_id"); JackGlobals::CheckContext("jack_client_thread_id");
@@ -1404,7 +1404,7 @@ EXPORT pthread_t jack_client_thread_id(jack_client_t* ext_client)
JackClient* client = (JackClient*)ext_client; JackClient* client = (JackClient*)ext_client;
if (client == NULL) { if (client == NULL) {
jack_error("jack_client_thread_id called with a NULL client"); jack_error("jack_client_thread_id called with a NULL client");
return (pthread_t)NULL;
return (jack_native_thread_t)NULL;
} else { } else {
return client->GetThreadID(); return client->GetThreadID();
} }
@@ -1595,7 +1595,7 @@ EXPORT void jack_set_transport_info(jack_client_t* ext_client, jack_transport_in
{ {
#ifdef __CLIENTDEBUG__ #ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_set_transport_info"); JackGlobals::CheckContext("jack_set_transport_info");
#endif
#endif
jack_error("jack_set_transport_info: deprecated"); jack_error("jack_set_transport_info: deprecated");
if (tinfo) if (tinfo)
memset(tinfo, 0, sizeof(jack_transport_info_t)); memset(tinfo, 0, sizeof(jack_transport_info_t));
@@ -1677,14 +1677,14 @@ EXPORT int jack_client_max_real_time_priority(jack_client_t* ext_client)
} }
} }


EXPORT int jack_acquire_real_time_scheduling(pthread_t thread, int priority)
EXPORT int jack_acquire_real_time_scheduling(jack_native_thread_t thread, int priority)
{ {
JackEngineControl* control = GetEngineControl(); JackEngineControl* control = GetEngineControl();
return (control ? JackThread::AcquireRealTimeImp(thread, priority, GetEngineControl()->fPeriod, GetEngineControl()->fComputation, GetEngineControl()->fConstraint) : -1); return (control ? JackThread::AcquireRealTimeImp(thread, priority, GetEngineControl()->fPeriod, GetEngineControl()->fComputation, GetEngineControl()->fConstraint) : -1);
} }


EXPORT int jack_client_create_thread(jack_client_t* client, EXPORT int jack_client_create_thread(jack_client_t* client,
pthread_t *thread,
jack_native_thread_t *thread,
int priority, int priority,
int realtime, /* boolean */ int realtime, /* boolean */
thread_routine routine, thread_routine routine,
@@ -1692,28 +1692,28 @@ EXPORT int jack_client_create_thread(jack_client_t* client,
{ {
#ifdef __CLIENTDEBUG__ #ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_client_create_thread"); JackGlobals::CheckContext("jack_client_create_thread");
#endif
#endif
return JackThread::StartImp(thread, priority, realtime, routine, arg); return JackThread::StartImp(thread, priority, realtime, routine, arg);
} }


EXPORT int jack_drop_real_time_scheduling(pthread_t thread)
EXPORT int jack_drop_real_time_scheduling(jack_native_thread_t thread)
{ {
return JackThread::DropRealTimeImp(thread); return JackThread::DropRealTimeImp(thread);
} }


EXPORT int jack_client_stop_thread(jack_client_t* client, pthread_t thread)
EXPORT int jack_client_stop_thread(jack_client_t* client, jack_native_thread_t thread)
{ {
#ifdef __CLIENTDEBUG__ #ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_client_stop_thread"); JackGlobals::CheckContext("jack_client_stop_thread");
#endif
#endif
return JackThread::StopImp(thread); return JackThread::StopImp(thread);
} }


EXPORT int jack_client_kill_thread(jack_client_t* client, pthread_t thread)
EXPORT int jack_client_kill_thread(jack_client_t* client, jack_native_thread_t thread)
{ {
#ifdef __CLIENTDEBUG__ #ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_client_kill_thread"); JackGlobals::CheckContext("jack_client_kill_thread");
#endif
#endif
return JackThread::KillImp(thread); return JackThread::KillImp(thread);
} }


@@ -1876,7 +1876,7 @@ EXPORT int jack_set_session_callback(jack_client_t* ext_client, JackSessionCallb
} }
} }


EXPORT jack_session_command_t *jack_session_notify(jack_client_t* ext_client, const char* target, jack_session_event_type_t ev_type, const char *path)
EXPORT jack_session_command_t *jack_session_notify(jack_client_t* ext_client, const char* target, jack_session_event_type_t ev_type, const char *path)
{ {
#ifdef __CLIENTDEBUG__ #ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_session_notify"); JackGlobals::CheckContext("jack_session_notify");


+ 1
- 1
common/JackClient.cpp View File

@@ -106,7 +106,7 @@ bool JackClient::IsActive()
return (GetClientControl()) ? GetClientControl()->fActive : false; return (GetClientControl()) ? GetClientControl()->fActive : false;
} }


pthread_t JackClient::GetThreadID()
jack_native_thread_t JackClient::GetThreadID()
{ {
return fThread.GetThreadID(); return fThread.GetThreadID();
} }


+ 1
- 1
common/JackClient.h View File

@@ -139,7 +139,7 @@ class JackClient : public JackClientInterface, public JackRunnableInterface
virtual int SetBufferSize(jack_nframes_t buffer_size); virtual int SetBufferSize(jack_nframes_t buffer_size);
virtual int SetFreeWheel(int onoff); virtual int SetFreeWheel(int onoff);
virtual void ShutDown(); virtual void ShutDown();
virtual pthread_t GetThreadID();
virtual jack_native_thread_t GetThreadID();


// Port management // Port management
virtual int PortRegister(const char* port_name, const char* port_type, unsigned long flags, unsigned long buffer_size); virtual int PortRegister(const char* port_name, const char* port_type, unsigned long flags, unsigned long buffer_size);


+ 2
- 2
common/JackDebugClient.h View File

@@ -12,7 +12,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.


You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.


*/ */
@@ -84,7 +84,7 @@ class JackDebugClient : public JackClient
int SetBufferSize(jack_nframes_t buffer_size); int SetBufferSize(jack_nframes_t buffer_size);
int SetFreeWheel(int onoff); int SetFreeWheel(int onoff);
void ShutDown(); void ShutDown();
pthread_t GetThreadID();
jack_native_thread_t GetThreadID();


// Port management // Port management
int PortRegister(const char* port_name, const char* port_type, unsigned long flags, unsigned long buffer_size); int PortRegister(const char* port_name, const char* port_type, unsigned long flags, unsigned long buffer_size);


+ 3
- 3
common/JackNetManager.h View File

@@ -54,7 +54,7 @@ namespace Jack


//sync and transport //sync and transport
int fLastTransportState; int fLastTransportState;
//monitoring //monitoring
#ifdef JACK_MONITOR #ifdef JACK_MONITOR
jack_time_t fPeriodUsecs; jack_time_t fPeriodUsecs;
@@ -64,7 +64,7 @@ namespace Jack
bool Init(bool auto_connect); bool Init(bool auto_connect);
int AllocPorts(); int AllocPorts();
void FreePorts(); void FreePorts();
//transport //transport
void EncodeTransportData(); void EncodeTransportData();
void DecodeTransportData(); void DecodeTransportData();
@@ -98,7 +98,7 @@ namespace Jack
const char* fManagerName; const char* fManagerName;
char fMulticastIP[32]; char fMulticastIP[32];
JackNetSocket fSocket; JackNetSocket fSocket;
pthread_t fManagerThread;
jack_native_thread_t fManagerThread;
master_list_t fMasterList; master_list_t fMasterList;
uint32_t fGlobalID; uint32_t fGlobalID;
bool fRunning; bool fRunning;


+ 28
- 28
common/JackThread.h View File

@@ -1,21 +1,21 @@
/* /*
Copyright (C) 2001 Paul Davis Copyright (C) 2001 Paul Davis
Copyright (C) 2004-2008 Grame Copyright (C) 2004-2008 Grame
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */


#ifndef __JackThread__ #ifndef __JackThread__
@@ -26,23 +26,23 @@


namespace Jack namespace Jack
{ {
/*! /*!
\brief The base class for runnable objects, that have an <B> Init </B> and <B> Execute </B> method to be called in a thread. \brief The base class for runnable objects, that have an <B> Init </B> and <B> Execute </B> method to be called in a thread.
*/ */


class JackRunnableInterface class JackRunnableInterface
{ {
protected: protected:
JackRunnableInterface() JackRunnableInterface()
{} {}
virtual ~JackRunnableInterface() virtual ~JackRunnableInterface()
{} {}
public: public:
virtual bool Init() /*! Called once when the thread is started */ virtual bool Init() /*! Called once when the thread is started */
{ {
return true; return true;
@@ -61,23 +61,23 @@ class SERVER_EXPORT JackThreadInterface
{ {


public: public:
enum kThreadState {kIdle, kStarting, kIniting, kRunning}; enum kThreadState {kIdle, kStarting, kIniting, kRunning};
protected: protected:
JackRunnableInterface* fRunnable; JackRunnableInterface* fRunnable;
int fPriority; int fPriority;
bool fRealTime; bool fRealTime;
volatile kThreadState fStatus; volatile kThreadState fStatus;
int fCancellation; int fCancellation;
public: public:
JackThreadInterface(JackRunnableInterface* runnable, int priority, bool real_time, int cancellation): JackThreadInterface(JackRunnableInterface* runnable, int priority, bool real_time, int cancellation):
fRunnable(runnable), fPriority(priority), fRealTime(real_time), fStatus(kIdle), fCancellation(cancellation) fRunnable(runnable), fPriority(priority), fRealTime(real_time), fStatus(kIdle), fCancellation(cancellation)
{} {}
kThreadState GetStatus() kThreadState GetStatus()
{ {
return fStatus; return fStatus;
@@ -86,10 +86,10 @@ class SERVER_EXPORT JackThreadInterface
{ {
fStatus = status; fStatus = status;
} }
void SetParams(UInt64 period, UInt64 computation, UInt64 constraint) // Empty implementation, will only make sense on OSX... void SetParams(UInt64 period, UInt64 computation, UInt64 constraint) // Empty implementation, will only make sense on OSX...
{} {}
int Start(); int Start();
int StartSync(); int StartSync();
int Kill(); int Kill();
@@ -98,24 +98,24 @@ class SERVER_EXPORT JackThreadInterface


int AcquireRealTime(); // Used when called from another thread int AcquireRealTime(); // Used when called from another thread
int AcquireSelfRealTime(); // Used when called from thread itself int AcquireSelfRealTime(); // Used when called from thread itself
int AcquireRealTime(int priority); // Used when called from another thread int AcquireRealTime(int priority); // Used when called from another thread
int AcquireSelfRealTime(int priority); // Used when called from thread itself int AcquireSelfRealTime(int priority); // Used when called from thread itself
int DropRealTime(); // Used when called from another thread int DropRealTime(); // Used when called from another thread
int DropSelfRealTime(); // Used when called from thread itself int DropSelfRealTime(); // Used when called from thread itself


pthread_t GetThreadID();
jack_native_thread_t GetThreadID();
bool IsThread(); bool IsThread();


static int AcquireRealTimeImp(pthread_t thread, int priority);
static int AcquireRealTimeImp(pthread_t thread, int priority, UInt64 period, UInt64 computation, UInt64 constraint);
static int DropRealTimeImp(pthread_t thread);
static int StartImp(pthread_t* thread, int priority, int realtime, void*(*start_routine)(void*), void* arg);
static int StopImp(pthread_t thread);
static int KillImp(pthread_t thread);
static int AcquireRealTimeImp(jack_native_thread_t thread, int priority);
static int AcquireRealTimeImp(jack_native_thread_t thread, int priority, UInt64 period, UInt64 computation, UInt64 constraint);
static int DropRealTimeImp(jack_native_thread_t thread);
static int StartImp(jack_native_thread_t* thread, int priority, int realtime, void*(*start_routine)(void*), void* arg);
static int StopImp(jack_native_thread_t thread);
static int KillImp(jack_native_thread_t thread);
}; };
} }


} // end of namespace } // end of namespace


+ 70
- 70
common/jack/jack.h View File

@@ -1,19 +1,19 @@
/* /*
Copyright (C) 2001 Paul Davis Copyright (C) 2001 Paul Davis
Copyright (C) 2004 Jack O'Quin Copyright (C) 2004 Jack O'Quin
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.


*/ */
@@ -33,21 +33,21 @@ extern "C"
/** /**
* Note: More documentation can be found in jack/types.h. * Note: More documentation can be found in jack/types.h.
*/ */
/************************************************************* /*************************************************************
* NOTE: JACK_WEAK_EXPORT ***MUST*** be used on every function * NOTE: JACK_WEAK_EXPORT ***MUST*** be used on every function
* added to the JACK API after the 0.116.2 release. * added to the JACK API after the 0.116.2 release.
*
* Functions that predate this release are marked with
*
* Functions that predate this release are marked with
* JACK_WEAK_OPTIONAL_EXPORT which can be defined at compile * JACK_WEAK_OPTIONAL_EXPORT which can be defined at compile
* time in a variety of ways. The default definition is empty, * time in a variety of ways. The default definition is empty,
* so that these symbols get normal linkage. If you wish to * so that these symbols get normal linkage. If you wish to
* use all JACK symbols with weak linkage, include
* use all JACK symbols with weak linkage, include
* <jack/weakjack.h> before jack.h. * <jack/weakjack.h> before jack.h.
*************************************************************/ *************************************************************/
#include <jack/weakmacros.h> #include <jack/weakmacros.h>
/** /**
* Call this function to get version of the JACK, in form of several numbers * Call this function to get version of the JACK, in form of several numbers
* *
@@ -200,7 +200,7 @@ int jack_get_client_pid (const char *name) JACK_OPTIONAL_WEAK_EXPORT;
* @return the pthread ID of the thread running the JACK client side * @return the pthread ID of the thread running the JACK client side
* code. * code.
*/ */
pthread_t jack_client_thread_id (jack_client_t *) JACK_OPTIONAL_WEAK_EXPORT;
jack_native_thread_t jack_client_thread_id (jack_client_t *) JACK_OPTIONAL_WEAK_EXPORT;


/*@}*/ /*@}*/


@@ -228,7 +228,7 @@ jack_nframes_t jack_thread_wait (jack_client_t*, int status) JACK_OPTIONAL_WEAK_


/** /**
* Wait until this JACK client should process data. * Wait until this JACK client should process data.
*
*
* @param client - pointer to a JACK client structure * @param client - pointer to a JACK client structure
* *
* @return the number of frames of data to process * @return the number of frames of data to process
@@ -237,7 +237,7 @@ jack_nframes_t jack_thread_wait (jack_client_t*, int status) JACK_OPTIONAL_WEAK_


/** /**
* Signal next clients in the graph. * Signal next clients in the graph.
*
*
* @param client - pointer to a JACK client structure * @param client - pointer to a JACK client structure
* @param status - if non-zero, calling thread should exit * @param status - if non-zero, calling thread should exit
*/ */
@@ -254,7 +254,7 @@ void jack_cycle_signal (jack_client_t* client, int status) JACK_OPTIONAL_WEAK_EX
* http://jackit.sourceforge.net/docs/design/design.html#SECTION00411000000000000000 * http://jackit.sourceforge.net/docs/design/design.html#SECTION00411000000000000000
* for more information. * for more information.
* *
* NOTE: this function cannot be called while the client is activated
* NOTE: this function cannot be called while the client is activated
* (after jack_activate has been called.) * (after jack_activate has been called.)
* *
* @return 0 on success, otherwise a non-zero error code. * @return 0 on success, otherwise a non-zero error code.
@@ -270,13 +270,13 @@ int jack_set_process_thread(jack_client_t* client, JackThreadCallback thread_cal


/** /**
* Tell JACK to call @a thread_init_callback once just after * Tell JACK to call @a thread_init_callback once just after
* the creation of the thread in which all other callbacks
* the creation of the thread in which all other callbacks
* will be handled. * will be handled.
* *
* The code in the supplied function does not need to be * The code in the supplied function does not need to be
* suitable for real-time execution. * suitable for real-time execution.
* *
* NOTE: this function cannot be called while the client is activated
* NOTE: this function cannot be called while the client is activated
* (after jack_activate has been called.) * (after jack_activate has been called.)
* *
* @return 0 on success, otherwise a non-zero error code, causing JACK * @return 0 on success, otherwise a non-zero error code, causing JACK
@@ -337,7 +337,7 @@ void jack_on_shutdown (jack_client_t *client,
*/ */
void jack_on_info_shutdown (jack_client_t *client, void jack_on_info_shutdown (jack_client_t *client,
JackInfoShutdownCallback shutdown_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT; JackInfoShutdownCallback shutdown_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT;
/** /**
* Tell the Jack server to call @a process_callback whenever there is * Tell the Jack server to call @a process_callback whenever there is
* work be done, passing @a arg as the second argument. * work be done, passing @a arg as the second argument.
@@ -350,7 +350,7 @@ void jack_on_info_shutdown (jack_client_t *client,
* http://jackit.sourceforge.net/docs/design/design.html#SECTION00411000000000000000 * http://jackit.sourceforge.net/docs/design/design.html#SECTION00411000000000000000
* for more information. * for more information.
* *
* NOTE: this function cannot be called while the client is activated
* NOTE: this function cannot be called while the client is activated
* (after jack_activate has been called.) * (after jack_activate has been called.)
* *
* @return 0 on success, otherwise a non-zero error code. * @return 0 on success, otherwise a non-zero error code.
@@ -370,7 +370,7 @@ int jack_set_process_callback (jack_client_t *client,
* the code in the supplied function does not need to be * the code in the supplied function does not need to be
* suitable for real-time execution. * suitable for real-time execution.
* *
* NOTE: this function cannot be called while the client is activated
* NOTE: this function cannot be called while the client is activated
* (after jack_activate has been called.) * (after jack_activate has been called.)
* *
* @return 0 on success, otherwise a non-zero error code. * @return 0 on success, otherwise a non-zero error code.
@@ -389,7 +389,7 @@ int jack_set_freewheel_callback (jack_client_t *client,
* the code in the supplied function does not need to be * the code in the supplied function does not need to be
* suitable for real-time execution. * suitable for real-time execution.
* *
* NOTE: this function cannot be called while the client is activated
* NOTE: this function cannot be called while the client is activated
* (after jack_activate has been called.) * (after jack_activate has been called.)
* *
* @param client pointer to JACK client structure. * @param client pointer to JACK client structure.
@@ -410,7 +410,7 @@ int jack_set_buffer_size_callback (jack_client_t *client,
* the code in the supplied function does not need to be * the code in the supplied function does not need to be
* suitable for real-time execution. * suitable for real-time execution.
* *
* NOTE: this function cannot be called while the client is activated
* NOTE: this function cannot be called while the client is activated
* (after jack_activate has been called.) * (after jack_activate has been called.)
* *
* @return 0 on success, otherwise a non-zero error code * @return 0 on success, otherwise a non-zero error code
@@ -427,7 +427,7 @@ int jack_set_sample_rate_callback (jack_client_t *client,
* the code in the supplied function does not need to be * the code in the supplied function does not need to be
* suitable for real-time execution. * suitable for real-time execution.
* *
* NOTE: this function cannot be called while the client is activated
* NOTE: this function cannot be called while the client is activated
* (after jack_activate has been called.) * (after jack_activate has been called.)
* *
* @return 0 on success, otherwise a non-zero error code * @return 0 on success, otherwise a non-zero error code
@@ -444,7 +444,7 @@ int jack_set_client_registration_callback (jack_client_t *,
* the code in the supplied function does not need to be * the code in the supplied function does not need to be
* suitable for real-time execution. * suitable for real-time execution.
* *
* NOTE: this function cannot be called while the client is activated
* NOTE: this function cannot be called while the client is activated
* (after jack_activate has been called.) * (after jack_activate has been called.)
* *
* @return 0 on success, otherwise a non-zero error code * @return 0 on success, otherwise a non-zero error code
@@ -452,7 +452,7 @@ int jack_set_client_registration_callback (jack_client_t *,
int jack_set_port_registration_callback (jack_client_t *, int jack_set_port_registration_callback (jack_client_t *,
JackPortRegistrationCallback JackPortRegistrationCallback
registration_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT; registration_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT;
/** /**
* Tell the JACK server to call @a connect_callback whenever a * Tell the JACK server to call @a connect_callback whenever a
* port is connected or disconnected, passing @a arg as a parameter. * port is connected or disconnected, passing @a arg as a parameter.
@@ -461,7 +461,7 @@ int jack_set_client_registration_callback (jack_client_t *,
* the code in the supplied function does not need to be * the code in the supplied function does not need to be
* suitable for real-time execution. * suitable for real-time execution.
* *
* NOTE: this function cannot be called while the client is activated
* NOTE: this function cannot be called while the client is activated
* (after jack_activate has been called.) * (after jack_activate has been called.)
* *
* @return 0 on success, otherwise a non-zero error code * @return 0 on success, otherwise a non-zero error code
@@ -478,7 +478,7 @@ int jack_set_port_connect_callback (jack_client_t *,
* the code in the supplied function does not need to be * the code in the supplied function does not need to be
* suitable for real-time execution. * suitable for real-time execution.
* *
* NOTE: this function cannot be called while the client is activated
* NOTE: this function cannot be called while the client is activated
* (after jack_activate has been called.) * (after jack_activate has been called.)
* *
* @return 0 on success, otherwise a non-zero error code * @return 0 on success, otherwise a non-zero error code
@@ -495,7 +495,7 @@ int jack_set_port_rename_callback (jack_client_t *,
* the code in the supplied function does not need to be * the code in the supplied function does not need to be
* suitable for real-time execution. * suitable for real-time execution.
* *
* NOTE: this function cannot be called while the client is activated
* NOTE: this function cannot be called while the client is activated
* (after jack_activate has been called.) * (after jack_activate has been called.)
* *
* @return 0 on success, otherwise a non-zero error code * @return 0 on success, otherwise a non-zero error code
@@ -512,39 +512,39 @@ int jack_set_graph_order_callback (jack_client_t *,
* the code in the supplied function does not need to be * the code in the supplied function does not need to be
* suitable for real-time execution. * suitable for real-time execution.
* *
* NOTE: this function cannot be called while the client is activated
* NOTE: this function cannot be called while the client is activated
* (after jack_activate has been called.) * (after jack_activate has been called.)
* *
* @return 0 on success, otherwise a non-zero error code * @return 0 on success, otherwise a non-zero error code
*/ */
int jack_set_xrun_callback (jack_client_t *, int jack_set_xrun_callback (jack_client_t *,
JackXRunCallback xrun_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT; JackXRunCallback xrun_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT;
/*@}*/ /*@}*/


/** /**
* @defgroup ServerClientControl Controlling & querying JACK server operation * @defgroup ServerClientControl Controlling & querying JACK server operation
* @{ * @{
*/ */
/** /**
* Start/Stop JACK's "freewheel" mode. * Start/Stop JACK's "freewheel" mode.
* *
* When in "freewheel" mode, JACK no longer waits for * When in "freewheel" mode, JACK no longer waits for
* any external event to begin the start of the next process * any external event to begin the start of the next process
* cycle.
* cycle.
* *
* As a result, freewheel mode causes "faster than realtime" * As a result, freewheel mode causes "faster than realtime"
* execution of a JACK graph. If possessed, real-time * execution of a JACK graph. If possessed, real-time
* scheduling is dropped when entering freewheel mode, and * scheduling is dropped when entering freewheel mode, and
* if appropriate it is reacquired when stopping. * if appropriate it is reacquired when stopping.
*
*
* IMPORTANT: on systems using capabilities to provide real-time * IMPORTANT: on systems using capabilities to provide real-time
* scheduling (i.e. Linux kernel 2.4), if onoff is zero, this function * scheduling (i.e. Linux kernel 2.4), if onoff is zero, this function
* must be called from the thread that originally called jack_activate().
* This restriction does not apply to other systems (e.g. Linux kernel 2.6
* must be called from the thread that originally called jack_activate().
* This restriction does not apply to other systems (e.g. Linux kernel 2.6
* or OS X). * or OS X).
*
*
* @param client pointer to JACK client structure * @param client pointer to JACK client structure
* @param onoff if non-zero, freewheel mode starts. Otherwise * @param onoff if non-zero, freewheel mode starts. Otherwise
* freewheel mode ends. * freewheel mode ends.
@@ -569,7 +569,7 @@ int jack_set_freewheel(jack_client_t* client, int onoff) JACK_OPTIONAL_WEAK_EXPO
* @return 0 on success, otherwise a non-zero error code * @return 0 on success, otherwise a non-zero error code
*/ */
int jack_set_buffer_size (jack_client_t *client, jack_nframes_t nframes) JACK_OPTIONAL_WEAK_EXPORT; int jack_set_buffer_size (jack_client_t *client, jack_nframes_t nframes) JACK_OPTIONAL_WEAK_EXPORT;
/** /**
* @return the sample rate of the jack system, as set by the user when * @return the sample rate of the jack system, as set by the user when
* jackd was started. * jackd was started.
@@ -613,7 +613,7 @@ float jack_cpu_load (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT;
* @defgroup PortFunctions Creating & manipulating ports * @defgroup PortFunctions Creating & manipulating ports
* @{ * @{
*/ */
/** /**
* Create a new port for the client. This is an object used for moving * Create a new port for the client. This is an object used for moving
* data of any type in or out of the client. Ports may be connected * data of any type in or out of the client. Ports may be connected
@@ -625,16 +625,16 @@ float jack_cpu_load (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT;
* name. Exceeding that will cause the port registration to fail and * name. Exceeding that will cause the port registration to fail and
* return NULL. * return NULL.
* *
* The @a port_name must be unique among all ports owned by this client.
* If the name is not unique, the registration will fail.
*
* The @a port_name must be unique among all ports owned by this client.
* If the name is not unique, the registration will fail.
*
* All ports have a type, which may be any non-NULL and non-zero * All ports have a type, which may be any non-NULL and non-zero
* length string, passed as an argument. Some port types are built * length string, passed as an argument. Some port types are built
* into the JACK API, currently only JACK_DEFAULT_AUDIO_TYPE. * into the JACK API, currently only JACK_DEFAULT_AUDIO_TYPE.
* *
* @param client pointer to JACK client structure. * @param client pointer to JACK client structure.
* @param port_name non-empty short name for the new port (not * @param port_name non-empty short name for the new port (not
* including the leading @a "client_name:"). Must be unique.
* including the leading @a "client_name:"). Must be unique.
* @param port_type port type name. If longer than * @param port_type port type name. If longer than
* jack_port_type_size(), only that many characters are significant. * jack_port_type_size(), only that many characters are significant.
* @param flags @ref JackPortFlags bit mask. * @param flags @ref JackPortFlags bit mask.
@@ -663,7 +663,7 @@ int jack_port_unregister (jack_client_t *, jack_port_t *) JACK_OPTIONAL_WEAK_EXP
* that can be written to; for an input port, it will be an area * that can be written to; for an input port, it will be an area
* containing the data from the port's connection(s), or * containing the data from the port's connection(s), or
* zero-filled. if there are multiple inbound connections, the data * zero-filled. if there are multiple inbound connections, the data
* will be mixed appropriately.
* will be mixed appropriately.
* *
* FOR OUTPUT PORTS ONLY : DEPRECATED in Jack 2.0 !! * FOR OUTPUT PORTS ONLY : DEPRECATED in Jack 2.0 !!
* --------------------------------------------------- * ---------------------------------------------------
@@ -672,9 +672,9 @@ int jack_port_unregister (jack_client_t *, jack_port_t *) JACK_OPTIONAL_WEAK_EXP
* either never cache the return value or ensure you have * either never cache the return value or ensure you have
* a "blocksize" callback and be sure to invalidate the cached * a "blocksize" callback and be sure to invalidate the cached
* address from there. * address from there.
*
*
* Caching output ports is DEPRECATED in Jack 2.0, due to some new optimization (like "pipelining"). * Caching output ports is DEPRECATED in Jack 2.0, due to some new optimization (like "pipelining").
* Port buffers have to be retrieved in each callback for proper functionning.
* Port buffers have to be retrieved in each callback for proper functionning.
*/ */
void * jack_port_get_buffer (jack_port_t *, jack_nframes_t) JACK_OPTIONAL_WEAK_EXPORT; void * jack_port_get_buffer (jack_port_t *, jack_nframes_t) JACK_OPTIONAL_WEAK_EXPORT;


@@ -759,7 +759,7 @@ const char ** jack_port_get_connections (const jack_port_t *port) JACK_OPTIONAL_
* you cannot use it in a GraphReordered handler. * you cannot use it in a GraphReordered handler.
* *
* 2) You need not be the owner of the port to get information * 2) You need not be the owner of the port to get information
* about its connections.
* about its connections.
* *
* @see jack_port_name_size() * @see jack_port_name_size()
*/ */
@@ -768,8 +768,8 @@ const char ** jack_port_get_all_connections (const jack_client_t *client,


/** /**
* *
* @deprecated This function will be removed from a future version
* of JACK. Do not use it. There is no replacement. It has
* @deprecated This function will be removed from a future version
* of JACK. Do not use it. There is no replacement. It has
* turned out to serve essentially no purpose in real-life * turned out to serve essentially no purpose in real-life
* JACK clients. * JACK clients.
*/ */
@@ -777,8 +777,8 @@ int jack_port_tie (jack_port_t *src, jack_port_t *dst) JACK_OPTIONAL_WEAK_DEPREC


/** /**
* *
* @deprecated This function will be removed from a future version
* of JACK. Do not use it. There is no replacement. It has
* @deprecated This function will be removed from a future version
* of JACK. Do not use it. There is no replacement. It has
* turned out to serve essentially no purpose in real-life * turned out to serve essentially no purpose in real-life
* JACK clients. * JACK clients.
*/ */
@@ -812,7 +812,7 @@ jack_nframes_t jack_port_get_total_latency (jack_client_t *,
* physical hardware controlled by the client. For example, * physical hardware controlled by the client. For example,
* for a client controlling a digital audio interface connected * for a client controlling a digital audio interface connected
* to an external digital converter, the latency setting should * to an external digital converter, the latency setting should
* include both buffering by the audio interface *and* the converter.
* include both buffering by the audio interface *and* the converter.
*/ */
void jack_port_set_latency (jack_port_t *, jack_nframes_t) JACK_OPTIONAL_WEAK_EXPORT; void jack_port_set_latency (jack_port_t *, jack_nframes_t) JACK_OPTIONAL_WEAK_EXPORT;


@@ -822,8 +822,8 @@ void jack_port_set_latency (jack_port_t *, jack_nframes_t) JACK_OPTIONAL_WEAK_EX
* latency of its port using @function jack_port_set_latency * latency of its port using @function jack_port_set_latency
* and wants to ensure that all signal pathways in the graph * and wants to ensure that all signal pathways in the graph
* are updated with respect to the values that will be returned * are updated with respect to the values that will be returned
* by @function jack_port_get_total_latency.
*
* by @function jack_port_get_total_latency.
*
* @return zero for successful execution of the request. non-zero * @return zero for successful execution of the request. non-zero
* otherwise. * otherwise.
*/ */
@@ -835,10 +835,10 @@ int jack_recompute_total_latency (jack_client_t*, jack_port_t* port) JACK_OPTION
* latency of its port using @function jack_port_set_latency * latency of its port using @function jack_port_set_latency
* and wants to ensure that all signal pathways in the graph * and wants to ensure that all signal pathways in the graph
* are updated with respect to the values that will be returned * are updated with respect to the values that will be returned
* by @function jack_port_get_total_latency. It allows a client
* to change multiple port latencies without triggering a
* by @function jack_port_get_total_latency. It allows a client
* to change multiple port latencies without triggering a
* recompute for each change. * recompute for each change.
*
*
* @return zero for successful execution of the request. non-zero * @return zero for successful execution of the request. non-zero
* otherwise. * otherwise.
*/ */
@@ -856,12 +856,12 @@ int jack_port_set_name (jack_port_t *port, const char *port_name) JACK_OPTIONAL_
/** /**
* Set @a alias as an alias for @a port. May be called at any time. * Set @a alias as an alias for @a port. May be called at any time.
* If the alias is longer than jack_port_name_size(), it will be truncated. * If the alias is longer than jack_port_name_size(), it will be truncated.
*
*
* After a successful call, and until JACK exits or * After a successful call, and until JACK exits or
* @function jack_port_unset_alias() is called, @alias may be * @function jack_port_unset_alias() is called, @alias may be
* used as a alternate name for the port. * used as a alternate name for the port.
* *
* Ports can have up to two aliases - if both are already
* Ports can have up to two aliases - if both are already
* set, this function will return an error. * set, this function will return an error.
* *
* @return 0 on success, otherwise a non-zero error code. * @return 0 on success, otherwise a non-zero error code.
@@ -870,8 +870,8 @@ int jack_port_set_alias (jack_port_t *port, const char *alias) JACK_OPTIONAL_WEA


/** /**
* Remove @a alias as an alias for @a port. May be called at any time. * Remove @a alias as an alias for @a port. May be called at any time.
*
* After a successful call, @a alias can no longer be
*
* After a successful call, @a alias can no longer be
* used as a alternate name for the port. * used as a alternate name for the port.
* *
* @return 0 on success, otherwise a non-zero error code. * @return 0 on success, otherwise a non-zero error code.
@@ -989,13 +989,13 @@ int jack_port_type_size(void) JACK_OPTIONAL_WEAK_EXPORT;
*/ */


/** /**
* @param port_name_pattern A regular expression used to select
* ports by name. If NULL or of zero length, no selection based
* @param port_name_pattern A regular expression used to select
* ports by name. If NULL or of zero length, no selection based
* on name will be carried out. * on name will be carried out.
* @param type_name_pattern A regular expression used to select
* ports by type. If NULL or of zero length, no selection based
* @param type_name_pattern A regular expression used to select
* ports by type. If NULL or of zero length, no selection based
* on type will be carried out. * on type will be carried out.
* @param flags A value used to select ports by their flags.
* @param flags A value used to select ports by their flags.
* If zero, no selection based on flags will be carried out. * If zero, no selection based on flags will be carried out.
* *
* @return a NULL-terminated array of ports that match the specified * @return a NULL-terminated array of ports that match the specified
@@ -1021,8 +1021,8 @@ jack_port_t * jack_port_by_name (jack_client_t *, const char *port_name) JACK_OP
*/ */
jack_port_t * jack_port_by_id (jack_client_t *client, jack_port_t * jack_port_by_id (jack_client_t *client,
jack_port_id_t port_id) JACK_OPTIONAL_WEAK_EXPORT; jack_port_id_t port_id) JACK_OPTIONAL_WEAK_EXPORT;
/*@}*/
/*@}*/


/** /**
* @defgroup TimeFunctions Handling time * @defgroup TimeFunctions Handling time
@@ -1052,7 +1052,7 @@ jack_nframes_t jack_frame_time (const jack_client_t *) JACK_OPTIONAL_WEAK_EXPORT
* This function may only be used from the process callback, and can * This function may only be used from the process callback, and can
* be used to interpret timestamps generated by jack_frame_time() in * be used to interpret timestamps generated by jack_frame_time() in
* other threads with respect to the current process cycle. * other threads with respect to the current process cycle.
*
*
* This is the only jack time function that returns exact time: * This is the only jack time function that returns exact time:
* when used during the process callback it always returns the same * when used during the process callback it always returns the same
* value (until the next process callback, where it will return * value (until the next process callback, where it will return
@@ -1075,8 +1075,8 @@ jack_nframes_t jack_time_to_frames(const jack_client_t *client, jack_time_t) JAC


/** /**
* @return return JACK's current system time in microseconds, * @return return JACK's current system time in microseconds,
* using the JACK clock source.
*
* using the JACK clock source.
*
* The value returned is guaranteed to be monotonic, but not linear. * The value returned is guaranteed to be monotonic, but not linear.
*/ */
jack_time_t jack_get_time() JACK_OPTIONAL_WEAK_EXPORT; jack_time_t jack_get_time() JACK_OPTIONAL_WEAK_EXPORT;
@@ -1129,7 +1129,7 @@ void jack_set_info_function (void (*func)(const char *)) JACK_OPTIONAL_WEAK_EXPO
/*@}*/ /*@}*/


/** /**
* The free function to be used on memory returned by jack_port_get_connections,
* The free function to be used on memory returned by jack_port_get_connections,
* jack_port_get_all_connections and jack_get_ports functions. * jack_port_get_all_connections and jack_get_ports functions.
* This is MANDATORY on Windows when otherwise all nasty runtime version related crashes can occur. * This is MANDATORY on Windows when otherwise all nasty runtime version related crashes can occur.
* Developers are strongly encouraged to use this function instead of the standard "free" function in new code. * Developers are strongly encouraged to use this function instead of the standard "free" function in new code.


+ 22
- 22
windows/JackWinThread.cpp View File

@@ -1,20 +1,20 @@
/* /*
Copyright (C) 2004-2008 Grame Copyright (C) 2004-2008 Grame
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */




@@ -30,19 +30,19 @@ DWORD WINAPI JackWinThread::ThreadHandler(void* arg)
{ {
JackWinThread* obj = (JackWinThread*)arg; JackWinThread* obj = (JackWinThread*)arg;
JackRunnableInterface* runnable = obj->fRunnable; JackRunnableInterface* runnable = obj->fRunnable;
// Signal creation thread when started with StartSync // Signal creation thread when started with StartSync
jack_log("ThreadHandler: start"); jack_log("ThreadHandler: start");
obj->fStatus = kIniting; obj->fStatus = kIniting;
// Call Init method // Call Init method
if (!runnable->Init()) { if (!runnable->Init()) {
jack_error("Thread init fails: thread quits"); jack_error("Thread init fails: thread quits");
return 0; return 0;
} }
obj->fStatus = kRunning; obj->fStatus = kRunning;
// If Init succeed, start the thread loop // If Init succeed, start the thread loop
bool res = true; bool res = true;
while (obj->fStatus == kRunning && res) { while (obj->fStatus == kRunning && res) {
@@ -80,11 +80,11 @@ int JackWinThread::Start()
return 0; return 0;
} }
} }
int JackWinThread::StartSync() int JackWinThread::StartSync()
{ {
fStatus = kStarting; fStatus = kStarting;
if (StartImp(&fThread, fPriority, fRealTime, ThreadHandler, this) < 0) { if (StartImp(&fThread, fPriority, fRealTime, ThreadHandler, this) < 0) {
fStatus = kIdle; fStatus = kIdle;
return -1; return -1;
@@ -97,7 +97,7 @@ int JackWinThread::StartSync()
} }
} }


int JackWinThread::StartImp(pthread_t* thread, int priority, int realtime, ThreadCallback start_routine, void* arg)
int JackWinThread::StartImp(jack_native_thread_t* thread, int priority, int realtime, ThreadCallback start_routine, void* arg)
{ {
DWORD id; DWORD id;
*thread = CreateThread(NULL, 0, start_routine, arg, 0, &id); *thread = CreateThread(NULL, 0, start_routine, arg, 0, &id);
@@ -108,7 +108,7 @@ int JackWinThread::StartImp(pthread_t* thread, int priority, int realtime, Threa
} }


if (realtime) { if (realtime) {
jack_log("Create RT thread"); jack_log("Create RT thread");
if (!SetThreadPriority(*thread, THREAD_PRIORITY_TIME_CRITICAL)) { if (!SetThreadPriority(*thread, THREAD_PRIORITY_TIME_CRITICAL)) {
jack_error("Cannot set priority class = %d", GetLastError()); jack_error("Cannot set priority class = %d", GetLastError());
@@ -118,7 +118,7 @@ int JackWinThread::StartImp(pthread_t* thread, int priority, int realtime, Threa
} else { } else {
jack_log("Create non RT thread"); jack_log("Create non RT thread");
} }
return 0; return 0;
} }


@@ -153,7 +153,7 @@ int JackWinThread::Stop()
} }
} }


int JackWinThread::KillImp(pthread_t thread)
int JackWinThread::KillImp(jack_native_thread_t thread)
{ {
if (thread != (HANDLE)NULL) { // If thread has been started if (thread != (HANDLE)NULL) { // If thread has been started
TerminateThread(thread, 0); TerminateThread(thread, 0);
@@ -165,7 +165,7 @@ int JackWinThread::KillImp(pthread_t thread)
} }
} }


int JackWinThread::StopImp(pthread_t thread)
int JackWinThread::StopImp(jack_native_thread_t thread)
{ {
if (thread) { // If thread has been started if (thread) { // If thread has been started
WaitForSingleObject(thread, INFINITE); WaitForSingleObject(thread, INFINITE);
@@ -198,7 +198,7 @@ int JackWinThread::AcquireSelfRealTime(int priority)
return AcquireSelfRealTime(); return AcquireSelfRealTime();
} }


int JackWinThread::AcquireRealTimeImp(pthread_t thread, int priority)
int JackWinThread::AcquireRealTimeImp(jack_native_thread_t thread, int priority)
{ {
jack_log("JackWinThread::AcquireRealTime"); jack_log("JackWinThread::AcquireRealTime");


@@ -220,7 +220,7 @@ int JackWinThread::DropSelfRealTime()
return DropRealTimeImp(GetCurrentThread()); return DropRealTimeImp(GetCurrentThread());
} }


int JackWinThread::DropRealTimeImp(pthread_t thread)
int JackWinThread::DropRealTimeImp(jack_native_thread_t thread)
{ {
if (SetThreadPriority(thread, THREAD_PRIORITY_NORMAL)) { if (SetThreadPriority(thread, THREAD_PRIORITY_NORMAL)) {
return 0; return 0;
@@ -230,7 +230,7 @@ int JackWinThread::DropRealTimeImp(pthread_t thread)
} }
} }


pthread_t JackWinThread::GetThreadID()
jack_native_thread_t JackWinThread::GetThreadID()
{ {
return fThread; return fThread;
} }
@@ -262,14 +262,14 @@ bool jack_get_thread_realtime_priority_range(int * min_ptr, int * max_ptr)
bool jack_tls_allocate_key(jack_tls_key *key_ptr) bool jack_tls_allocate_key(jack_tls_key *key_ptr)
{ {
DWORD key; DWORD key;
key = TlsAlloc(); key = TlsAlloc();
if (key == TLS_OUT_OF_INDEXES) if (key == TLS_OUT_OF_INDEXES)
{ {
jack_error("TlsAlloc() failed. Error is %d", (unsigned int)GetLastError()); jack_error("TlsAlloc() failed. Error is %d", (unsigned int)GetLastError());
return false; return false;
} }
*key_ptr = key; *key_ptr = key;
return true; return true;
} }
@@ -281,7 +281,7 @@ bool jack_tls_free_key(jack_tls_key key)
jack_error("TlsFree() failed. Error is %d", (unsigned int)GetLastError()); jack_error("TlsFree() failed. Error is %d", (unsigned int)GetLastError());
return false; return false;
} }
return true; return true;
} }


@@ -292,7 +292,7 @@ bool jack_tls_set(jack_tls_key key, void *data_ptr)
jack_error("TlsSetValue() failed. Error is %d", (unsigned int)GetLastError()); jack_error("TlsSetValue() failed. Error is %d", (unsigned int)GetLastError());
return false; return false;
} }
return true; return true;
} }




+ 8
- 8
windows/JackWinThread.h View File

@@ -66,22 +66,22 @@ class SERVER_EXPORT JackWinThread : public detail::JackThreadInterface
int DropRealTime(); // Used when called from another thread int DropRealTime(); // Used when called from another thread
int DropSelfRealTime(); // Used when called from thread itself int DropSelfRealTime(); // Used when called from thread itself


pthread_t GetThreadID();
jack_native_thread_t GetThreadID();
bool IsThread(); bool IsThread();


static int AcquireRealTimeImp(pthread_t thread, int priority);
static int AcquireRealTimeImp(pthread_t thread, int priority, UInt64 period, UInt64 computation, UInt64 constraint)
static int AcquireRealTimeImp(jack_native_thread_t thread, int priority);
static int AcquireRealTimeImp(jack_native_thread_t thread, int priority, UInt64 period, UInt64 computation, UInt64 constraint)
{ {
return JackWinThread::AcquireRealTimeImp(thread, priority); return JackWinThread::AcquireRealTimeImp(thread, 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 DropRealTimeImp(jack_native_thread_t thread);
static int StartImp(jack_native_thread_t* thread, int priority, int realtime, void*(*start_routine)(void*), void* arg)
{ {
return JackWinThread::StartImp(thread, priority, realtime, (ThreadCallback) start_routine, arg); return JackWinThread::StartImp(thread, priority, realtime, (ThreadCallback) start_routine, arg);
} }
static int StartImp(pthread_t* thread, int priority, int realtime, ThreadCallback start_routine, void* arg);
static int StopImp(pthread_t thread);
static int KillImp(pthread_t thread);
static int StartImp(jack_native_thread_t* thread, int priority, int realtime, ThreadCallback start_routine, void* arg);
static int StopImp(jack_native_thread_t thread);
static int KillImp(jack_native_thread_t thread);


}; };




Loading…
Cancel
Save