diff --git a/common/JackAPI.cpp b/common/JackAPI.cpp index fe60ebe2..0c634f31 100644 --- a/common/JackAPI.cpp +++ b/common/JackAPI.cpp @@ -179,7 +179,7 @@ extern "C" 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 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_info_function (print_function); @@ -213,17 +213,17 @@ extern "C" EXPORT int jack_client_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, - pthread_t *thread, + jack_native_thread_t *thread, int priority, int realtime, // boolean thread_routine routine, 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 EXPORT void jack_set_thread_creator (jack_thread_creator_t jtc); #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__ 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; if (client == NULL) { jack_error("jack_client_thread_id called with a NULL client"); - return (pthread_t)NULL; + return (jack_native_thread_t)NULL; } else { return client->GetThreadID(); } @@ -1595,7 +1595,7 @@ EXPORT void jack_set_transport_info(jack_client_t* ext_client, jack_transport_in { #ifdef __CLIENTDEBUG__ JackGlobals::CheckContext("jack_set_transport_info"); -#endif +#endif jack_error("jack_set_transport_info: deprecated"); if (tinfo) 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(); return (control ? JackThread::AcquireRealTimeImp(thread, priority, GetEngineControl()->fPeriod, GetEngineControl()->fComputation, GetEngineControl()->fConstraint) : -1); } EXPORT int jack_client_create_thread(jack_client_t* client, - pthread_t *thread, + jack_native_thread_t *thread, int priority, int realtime, /* boolean */ thread_routine routine, @@ -1692,28 +1692,28 @@ EXPORT int jack_client_create_thread(jack_client_t* client, { #ifdef __CLIENTDEBUG__ JackGlobals::CheckContext("jack_client_create_thread"); -#endif +#endif 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); } -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__ JackGlobals::CheckContext("jack_client_stop_thread"); -#endif +#endif 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__ JackGlobals::CheckContext("jack_client_kill_thread"); -#endif +#endif 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__ JackGlobals::CheckContext("jack_session_notify"); diff --git a/common/JackClient.cpp b/common/JackClient.cpp index 072a4b90..7bbfb2a8 100644 --- a/common/JackClient.cpp +++ b/common/JackClient.cpp @@ -106,7 +106,7 @@ bool JackClient::IsActive() return (GetClientControl()) ? GetClientControl()->fActive : false; } -pthread_t JackClient::GetThreadID() +jack_native_thread_t JackClient::GetThreadID() { return fThread.GetThreadID(); } diff --git a/common/JackClient.h b/common/JackClient.h index 588c5912..7b253661 100644 --- a/common/JackClient.h +++ b/common/JackClient.h @@ -139,7 +139,7 @@ class JackClient : public JackClientInterface, public JackRunnableInterface virtual int SetBufferSize(jack_nframes_t buffer_size); virtual int SetFreeWheel(int onoff); virtual void ShutDown(); - virtual pthread_t GetThreadID(); + virtual jack_native_thread_t GetThreadID(); // Port management virtual int PortRegister(const char* port_name, const char* port_type, unsigned long flags, unsigned long buffer_size); diff --git a/common/JackDebugClient.h b/common/JackDebugClient.h index fc9ebf55..6a19deca 100644 --- a/common/JackDebugClient.h +++ b/common/JackDebugClient.h @@ -12,7 +12,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 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. */ @@ -84,7 +84,7 @@ class JackDebugClient : public JackClient int SetBufferSize(jack_nframes_t buffer_size); int SetFreeWheel(int onoff); void ShutDown(); - pthread_t GetThreadID(); + jack_native_thread_t GetThreadID(); // Port management int PortRegister(const char* port_name, const char* port_type, unsigned long flags, unsigned long buffer_size); diff --git a/common/JackNetManager.h b/common/JackNetManager.h index 29c8386d..cbeaee9e 100644 --- a/common/JackNetManager.h +++ b/common/JackNetManager.h @@ -54,7 +54,7 @@ namespace Jack //sync and transport int fLastTransportState; - + //monitoring #ifdef JACK_MONITOR jack_time_t fPeriodUsecs; @@ -64,7 +64,7 @@ namespace Jack bool Init(bool auto_connect); int AllocPorts(); void FreePorts(); - + //transport void EncodeTransportData(); void DecodeTransportData(); @@ -98,7 +98,7 @@ namespace Jack const char* fManagerName; char fMulticastIP[32]; JackNetSocket fSocket; - pthread_t fManagerThread; + jack_native_thread_t fManagerThread; master_list_t fMasterList; uint32_t fGlobalID; bool fRunning; diff --git a/common/JackThread.h b/common/JackThread.h index 34dd798c..a61c5ab1 100644 --- a/common/JackThread.h +++ b/common/JackThread.h @@ -1,21 +1,21 @@ /* Copyright (C) 2001 Paul Davis Copyright (C) 2004-2008 Grame - + 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 the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + 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. - + */ #ifndef __JackThread__ @@ -26,23 +26,23 @@ namespace Jack { - + /*! \brief The base class for runnable objects, that have an Init and Execute method to be called in a thread. */ class JackRunnableInterface { - + protected: - + JackRunnableInterface() {} virtual ~JackRunnableInterface() {} - + public: - + virtual bool Init() /*! Called once when the thread is started */ { return true; @@ -61,23 +61,23 @@ class SERVER_EXPORT JackThreadInterface { public: - + enum kThreadState {kIdle, kStarting, kIniting, kRunning}; - + protected: - + JackRunnableInterface* fRunnable; int fPriority; bool fRealTime; volatile kThreadState fStatus; int fCancellation; - + public: - + JackThreadInterface(JackRunnableInterface* runnable, int priority, bool real_time, int cancellation): fRunnable(runnable), fPriority(priority), fRealTime(real_time), fStatus(kIdle), fCancellation(cancellation) {} - + kThreadState GetStatus() { return fStatus; @@ -86,10 +86,10 @@ class SERVER_EXPORT JackThreadInterface { fStatus = status; } - + void SetParams(UInt64 period, UInt64 computation, UInt64 constraint) // Empty implementation, will only make sense on OSX... {} - + int Start(); int StartSync(); int Kill(); @@ -98,24 +98,24 @@ class SERVER_EXPORT JackThreadInterface int AcquireRealTime(); // Used when called from another thread int AcquireSelfRealTime(); // Used when called from thread itself - + int AcquireRealTime(int priority); // Used when called from another thread int AcquireSelfRealTime(int priority); // Used when called from thread itself - + int DropRealTime(); // Used when called from another thread int DropSelfRealTime(); // Used when called from thread itself - pthread_t GetThreadID(); + jack_native_thread_t GetThreadID(); 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 diff --git a/common/jack/jack.h b/common/jack/jack.h index a63fcd12..70ee1c3e 100644 --- a/common/jack/jack.h +++ b/common/jack/jack.h @@ -1,19 +1,19 @@ /* Copyright (C) 2001 Paul Davis Copyright (C) 2004 Jack O'Quin - + 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 the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + 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. */ @@ -33,21 +33,21 @@ extern "C" /** * Note: More documentation can be found in jack/types.h. */ - + /************************************************************* * NOTE: JACK_WEAK_EXPORT ***MUST*** be used on every function * 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 * time in a variety of ways. The default definition is empty, * 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 * before jack.h. *************************************************************/ - + #include - + /** * 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 * 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. - * + * * @param client - pointer to a JACK client structure * * @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. - * + * * @param client - pointer to a JACK client structure * @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 * 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.) * * @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 - * the creation of the thread in which all other callbacks + * the creation of the thread in which all other callbacks * will be handled. * * The code in the supplied function does not need to be * 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.) * * @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, JackInfoShutdownCallback shutdown_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT; - + /** * Tell the Jack server to call @a process_callback whenever there is * 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 * 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.) * * @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 * 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.) * * @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 * 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.) * * @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 * 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.) * * @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 * 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.) * * @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 * 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.) * * @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 *, JackPortRegistrationCallback registration_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT; - + /** * Tell the JACK server to call @a connect_callback whenever a * 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 * 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.) * * @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 * 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.) * * @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 * 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.) * * @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 * 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.) * * @return 0 on success, otherwise a non-zero error code */ int jack_set_xrun_callback (jack_client_t *, JackXRunCallback xrun_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT; - + /*@}*/ /** * @defgroup ServerClientControl Controlling & querying JACK server operation * @{ */ - + /** * Start/Stop JACK's "freewheel" mode. * * When in "freewheel" mode, JACK no longer waits for * any external event to begin the start of the next process - * cycle. + * cycle. * * As a result, freewheel mode causes "faster than realtime" * execution of a JACK graph. If possessed, real-time * scheduling is dropped when entering freewheel mode, and * if appropriate it is reacquired when stopping. - * + * * IMPORTANT: on systems using capabilities to provide real-time * 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). - * + * * @param client pointer to JACK client structure * @param onoff if non-zero, freewheel mode starts. Otherwise * 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 */ 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 * jackd was started. @@ -613,7 +613,7 @@ float jack_cpu_load (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT; * @defgroup PortFunctions Creating & manipulating ports * @{ */ - + /** * 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 @@ -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 * 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 * length string, passed as an argument. Some port types are built * into the JACK API, currently only JACK_DEFAULT_AUDIO_TYPE. * * @param client pointer to JACK client structure. * @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 * jack_port_type_size(), only that many characters are significant. * @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 * containing the data from the port's connection(s), or * 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 !! * --------------------------------------------------- @@ -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 * a "blocksize" callback and be sure to invalidate the cached * address from there. - * + * * 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; @@ -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. * * 2) You need not be the owner of the port to get information - * about its connections. + * about its connections. * * @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 * 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 * 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, * for a client controlling a digital audio interface connected * 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; @@ -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 * and wants to ensure that all signal pathways in the graph * 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 * 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 * and wants to ensure that all signal pathways in the graph * 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. -* +* * @return zero for successful execution of the request. non-zero * 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. * If the alias is longer than jack_port_name_size(), it will be truncated. - * + * * After a successful call, and until JACK exits or * @function jack_port_unset_alias() is called, @alias may be * 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. * * @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. - * - * 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. * * @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. - * @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. - * @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. * * @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_id_t port_id) JACK_OPTIONAL_WEAK_EXPORT; - -/*@}*/ + +/*@}*/ /** * @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 * be used to interpret timestamps generated by jack_frame_time() in * other threads with respect to the current process cycle. - * + * * This is the only jack time function that returns exact time: * when used during the process callback it always returns the same * 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, - * using the JACK clock source. - * + * using the JACK clock source. + * * The value returned is guaranteed to be monotonic, but not linear. */ 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. * 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. diff --git a/windows/JackWinThread.cpp b/windows/JackWinThread.cpp index ec884c45..e3f2cdd9 100644 --- a/windows/JackWinThread.cpp +++ b/windows/JackWinThread.cpp @@ -1,20 +1,20 @@ /* Copyright (C) 2004-2008 Grame - + 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 the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software 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; JackRunnableInterface* runnable = obj->fRunnable; - + // Signal creation thread when started with StartSync jack_log("ThreadHandler: start"); obj->fStatus = kIniting; - + // Call Init method if (!runnable->Init()) { jack_error("Thread init fails: thread quits"); return 0; } - + obj->fStatus = kRunning; - + // If Init succeed, start the thread loop bool res = true; while (obj->fStatus == kRunning && res) { @@ -80,11 +80,11 @@ int JackWinThread::Start() return 0; } } - + int JackWinThread::StartSync() { fStatus = kStarting; - + if (StartImp(&fThread, fPriority, fRealTime, ThreadHandler, this) < 0) { fStatus = kIdle; 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; *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) { - + jack_log("Create RT thread"); if (!SetThreadPriority(*thread, THREAD_PRIORITY_TIME_CRITICAL)) { jack_error("Cannot set priority class = %d", GetLastError()); @@ -118,7 +118,7 @@ int JackWinThread::StartImp(pthread_t* thread, int priority, int realtime, Threa } else { jack_log("Create non RT thread"); } - + 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 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 WaitForSingleObject(thread, INFINITE); @@ -198,7 +198,7 @@ int JackWinThread::AcquireSelfRealTime(int priority) return AcquireSelfRealTime(); } -int JackWinThread::AcquireRealTimeImp(pthread_t thread, int priority) +int JackWinThread::AcquireRealTimeImp(jack_native_thread_t thread, int priority) { jack_log("JackWinThread::AcquireRealTime"); @@ -220,7 +220,7 @@ int JackWinThread::DropSelfRealTime() return DropRealTimeImp(GetCurrentThread()); } -int JackWinThread::DropRealTimeImp(pthread_t thread) +int JackWinThread::DropRealTimeImp(jack_native_thread_t thread) { if (SetThreadPriority(thread, THREAD_PRIORITY_NORMAL)) { return 0; @@ -230,7 +230,7 @@ int JackWinThread::DropRealTimeImp(pthread_t thread) } } -pthread_t JackWinThread::GetThreadID() +jack_native_thread_t JackWinThread::GetThreadID() { 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) { DWORD key; - + key = TlsAlloc(); if (key == TLS_OUT_OF_INDEXES) { jack_error("TlsAlloc() failed. Error is %d", (unsigned int)GetLastError()); return false; } - + *key_ptr = key; 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()); return false; } - + 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()); return false; } - + return true; } diff --git a/windows/JackWinThread.h b/windows/JackWinThread.h index 317d6aeb..6861b6fc 100644 --- a/windows/JackWinThread.h +++ b/windows/JackWinThread.h @@ -66,22 +66,22 @@ class SERVER_EXPORT JackWinThread : public detail::JackThreadInterface int DropRealTime(); // Used when called from another thread int DropSelfRealTime(); // Used when called from thread itself - pthread_t GetThreadID(); + jack_native_thread_t GetThreadID(); 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); } - 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); } - 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); };