From c7d1f89d6908f926edd122655354cd46bdf58292 Mon Sep 17 00:00:00 2001 From: sletz Date: Mon, 5 Nov 2007 10:20:20 +0000 Subject: [PATCH] Use of JackWinSemaphore instead of JackWinEvent for inter-process synchronization. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@1702 0c269be4-1314-0410-8aa9-9f06e86f4224 --- ChangeLog | 146 ++++++++++++++++++----------------- common/JackGlobalsClient.cpp | 5 +- common/JackGlobalsServer.cpp | 5 +- common/JackTools.cpp | 39 ++++++++-- windows/libjackdmp.dsp | 8 +- windows/libjackmp.dsp | 8 +- 6 files changed, 127 insertions(+), 84 deletions(-) diff --git a/ChangeLog b/ChangeLog index d352c57c..ceae2029 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,58 +7,62 @@ Steven Chamberlain Thom Johansen Thibault LeMeur Pieter Palmers -Tom Szilagyi +Tom Szilagyi Andrzej Szombierski --------------------------- Jackdmp changes log ---------------------------- - -2007-11-04 Stephane Letz - - * Add an implementation for obsolete jack_internal_client_new and .jack_internal_client_close. Add missing jack_port_type_size. - -2007-11-02 Stephane Letz - - * Correct ALSA driver Attach method: internal driver may have changed the buffer_size and sample_rate values. - * Add JackWinSemaphore class. - -2007-10-01 Stephane Letz - - * Server and user directory related code moved in a JackTools file. - * Client name rewritting to remove path characters (used in fifo naming). - -2007-10-30 Stephane Letz - - * Fix a bug in freewheel management in async mode: drivers now receive the kStartFreewheelCallback and kStopFreewheelCallback notifications. - -2007-10-26 Stephane Letz - - * Add midiseq and midisine examples. - * Cleanup old zombification code. - * Linux Makefile now install jack headers. - * Use of JACK_CLIENT_DEBUG environment variable to activate debug client mode. - * Definition of JACK_LOCATION variable using -D in the Makefile. - * Restore jack 0.103.0 MIDI API version. - -2007-10-25 Stephane Letz - - * Merge of Dmitry Baikov MIDI branch. - * Correct JackGraphManager::GetPortsAux to use port type. +--------------------------- + +2007-11-05 Stephane Letz + + * Use of JackWinSemaphore instead of JackWinEvent for inter-process synchronization. + +2007-11-04 Stephane Letz + + * Add an implementation for obsolete jack_internal_client_new and .jack_internal_client_close. Add missing jack_port_type_size. + +2007-11-02 Stephane Letz + + * Correct ALSA driver Attach method: internal driver may have changed the buffer_size and sample_rate values. + * Add JackWinSemaphore class. + +2007-10-01 Stephane Letz + + * Server and user directory related code moved in a JackTools file. + * Client name rewritting to remove path characters (used in fifo naming). + +2007-10-30 Stephane Letz + + * Fix a bug in freewheel management in async mode: drivers now receive the kStartFreewheelCallback and kStopFreewheelCallback notifications. + +2007-10-26 Stephane Letz + + * Add midiseq and midisine examples. + * Cleanup old zombification code. + * Linux Makefile now install jack headers. + * Use of JACK_CLIENT_DEBUG environment variable to activate debug client mode. + * Definition of JACK_LOCATION variable using -D in the Makefile. + * Restore jack 0.103.0 MIDI API version. + +2007-10-25 Stephane Letz + + * Merge of Dmitry Baikov MIDI branch. + * Correct JackGraphManager::GetPortsAux to use port type. * Remove JackEngineTiming class: code moved in JackEngineControl. - -2007-10-24 Stephane Letz - + +2007-10-24 Stephane Letz + * Implementation of server_name setting (-n). - -2007-10-23 Stephane Letz - + +2007-10-23 Stephane Letz + * Correct jack_acquire_real_time_scheduling on OSX. - + 2007-10-18 Stephane Letz * Use LIB_DIR variable for 64 bits related compilation (drivers location). More generic Linux script. - + 2007-10-16 Stephane Letz * Reorganize jack headers. Improve Linux install/remove scripts. @@ -164,10 +168,10 @@ Andrzej Szombierski 2007-05-29 Stephane Letz * Add "callback exiting" and "jack_frame_time" tests in jack_test. - -2007-05-09 Stephane Letz - - * Add a mutex in JackGraphManager AllocatePort/ReleasePort methods. + +2007-05-09 Stephane Letz + + * Add a mutex in JackGraphManager AllocatePort/ReleasePort methods. 2007-05-05 Stephane Letz @@ -192,38 +196,38 @@ Andrzej Szombierski 2007-04-23 Stephane Letz * Dmitry Baikov jackmp-time patch: add jack_get_time, jack_time_to_frames, jack_frames_to_time. - -2007-04-03 Stephane Letz - - * Dmitry Baikov remove-nframes patch. - -2007-04-02 Stephane Letz - - * Dmitry Baikov lost-event patch. + +2007-04-03 Stephane Letz + + * Dmitry Baikov remove-nframes patch. + +2007-04-02 Stephane Letz + + * Dmitry Baikov lost-event patch. 2007-04-01 Stephane Letz * Merge JackGraphManager Remove and Release method in a unique Release method. - -2007-03-12 Stephane Letz - - * Bug fix in JackMidiBuffer::MaxEventSize(). - -2007-03-09 Stephane Letz - - * Dmitry Baikov MIDI patch phase 2. - -2007-03-08 Stephane Letz - - * Dmitry Baikov jackmp-port-clear patch. - -2007-03-06 Stephane Letz - - * Dmitry Baikov MIDI patch phase 1. + +2007-03-12 Stephane Letz + + * Bug fix in JackMidiBuffer::MaxEventSize(). + +2007-03-09 Stephane Letz + + * Dmitry Baikov MIDI patch phase 2. + +2007-03-08 Stephane Letz + + * Dmitry Baikov jackmp-port-clear patch. + +2007-03-06 Stephane Letz + + * Dmitry Baikov MIDI patch phase 1. 2007-03-04 Stephane Letz - * Dmitry Baikov patch for JackGraphManager.cpp. + * Dmitry Baikov patch for JackGraphManager.cpp. * Dmitry Baikov MIDI patch phase 0. 2007-02-19 Stephane Letz diff --git a/common/JackGlobalsClient.cpp b/common/JackGlobalsClient.cpp index 4f168917..fc1bcf3b 100644 --- a/common/JackGlobalsClient.cpp +++ b/common/JackGlobalsClient.cpp @@ -42,7 +42,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #ifdef WIN32 #include "JackWinProcessSync.h" #include "JackWinNamedPipeClientChannel.h" -#include "JackWinEvent.h" +#include "JackWinEvent.h" +#include "JackWinSemaphore.h" #include "JackWinThread.h" #endif @@ -69,7 +70,7 @@ namespace Jack JackSynchro* JackFactoryWindowsClient::MakeSynchro() { - return new JackWinEvent(); + return new JackWinSemaphore(); } JackServerNotifyChannelInterface* JackFactoryWindowsClient::MakeServerNotifyChannel() diff --git a/common/JackGlobalsServer.cpp b/common/JackGlobalsServer.cpp index 1366fd94..8d76a733 100644 --- a/common/JackGlobalsServer.cpp +++ b/common/JackGlobalsServer.cpp @@ -50,7 +50,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #include "JackWinNamedPipeNotifyChannel.h" #include "JackWinNamedPipeServerChannel.h" #include "JackWinNamedPipeClientChannel.h" -#include "JackWinEvent.h" +#include "JackWinEvent.h" +#include "JackWinSemaphore.h" #include "JackWinThread.h" #endif @@ -79,7 +80,7 @@ namespace Jack #ifdef WIN32 JackSynchro* JackFactoryWindowsServer::MakeSynchro() { - return new JackWinEvent(); + return new JackWinSemaphore(); } JackServerNotifyChannelInterface* JackFactoryWindowsServer::MakeServerNotifyChannel() diff --git a/common/JackTools.cpp b/common/JackTools.cpp index 6b88196a..c6116537 100644 --- a/common/JackTools.cpp +++ b/common/JackTools.cpp @@ -19,7 +19,11 @@ #include "JackTools.h" #include "JackError.h" -#include +#include + +#ifdef WIN32 +#include +#endif namespace Jack { @@ -39,8 +43,8 @@ int JackTools::GetPID() int JackTools::GetUID() { #ifdef WIN32 - //return _getpid(); - #error "No getuid function available" + return _getpid(); + //#error "No getuid function available" #else return getuid(); #endif @@ -54,7 +58,30 @@ char* JackTools::DefaultServerName() return server_name; } -/* returns the name of the per-user subdirectory of jack_tmpdir */ +/* returns the name of the per-user subdirectory of jack_tmpdir */ +#ifdef WIN32 + +char* JackTools::UserDir() +{ + return ""; +} + +char* JackTools::ServerDir(const char* server_name, char* server_dir) +{ + return ""; +} + +void JackTools::CleanupFiles(const char* server_name) +{ + +} + +int JackTools::GetTmpdir() +{ + return 0; +} + +#else char* JackTools::UserDir() { static char user_dir[PATH_MAX + 1] = ""; @@ -170,6 +197,7 @@ int JackTools::GetTmpdir() fclose(in); return 0; } +#endif void JackTools::RewriteName(const char* name, char* new_name) { @@ -181,6 +209,7 @@ void JackTools::RewriteName(const char* name, char* new_name) new_name[i] = name[i]; } new_name[i] = '\0'; -} +} + } diff --git a/windows/libjackdmp.dsp b/windows/libjackdmp.dsp index dd1eccf7..f935dae3 100644 --- a/windows/libjackdmp.dsp +++ b/windows/libjackdmp.dsp @@ -215,11 +215,11 @@ SOURCE=..\common\JackTime.c # End Source File # Begin Source File -SOURCE=..\common\JackTransportEngine.cpp +SOURCE=..\common\JackTools.cpp # End Source File # Begin Source File -SOURCE=.\JackWinEvent.cpp +SOURCE=..\common\JackTransportEngine.cpp # End Source File # Begin Source File @@ -243,6 +243,10 @@ SOURCE=.\JackWinNamedPipeServerNotifyChannel.cpp # End Source File # Begin Source File +SOURCE=.\JackWinSemaphore.cpp +# End Source File +# Begin Source File + SOURCE=.\JackWinThread.cpp # End Source File # Begin Source File diff --git a/windows/libjackmp.dsp b/windows/libjackmp.dsp index ee10df78..ecc3b7a2 100644 --- a/windows/libjackmp.dsp +++ b/windows/libjackmp.dsp @@ -167,11 +167,11 @@ SOURCE=..\common\JackTime.c # End Source File # Begin Source File -SOURCE=..\common\JackTransportEngine.cpp +SOURCE=..\common\JackTools.cpp # End Source File # Begin Source File -SOURCE=.\JackWinEvent.cpp +SOURCE=..\common\JackTransportEngine.cpp # End Source File # Begin Source File @@ -183,6 +183,10 @@ SOURCE=.\JackWinNamedPipeClientChannel.cpp # End Source File # Begin Source File +SOURCE=.\JackWinSemaphore.cpp +# End Source File +# Begin Source File + SOURCE=.\JackWinThread.cpp # End Source File # Begin Source File