Browse Source

Ugly temporary fix for netmanager deadlock.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2882 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/1.90
sletz 16 years ago
parent
commit
713e8dfdb2
5 changed files with 24 additions and 1 deletions
  1. +6
    -0
      common/JackNetInterface.cpp
  2. +7
    -0
      posix/JackPosixThread.cpp
  3. +2
    -1
      posix/JackPosixThread.h
  4. +7
    -0
      windows/JackWinThread.cpp
  5. +2
    -0
      windows/JackWinThread.h

+ 6
- 0
common/JackNetInterface.cpp View File

@@ -19,6 +19,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

#include "JackNetInterface.h"
#include "JackException.h"
#include "JackPlatformPlug.h"

using namespace std;

@@ -284,6 +285,7 @@ namespace Jack

//stop process
fRunning = false;
//send a 'multicast euthanasia request' - new socket is required on macosx
jack_info ( "Exiting '%s'", fParams.fName );
SetPacketType ( &fParams, KILL_MASTER );
@@ -293,6 +295,9 @@ namespace Jack
if ( mcast_socket.SendTo ( &fParams, sizeof ( session_params_t ), 0, fMulticastIP ) == SOCKET_ERROR )
jack_error ( "Can't send suicide request : %s", StrError ( NET_ERROR_CODE ) );
mcast_socket.Close();
// UGLY temporary way to be sure the thread does not call code possibly causing a deadlock in JackEngine.
ThreadExit();
}

int JackNetMasterInterface::Send ( size_t size, int flags )
@@ -487,6 +492,7 @@ namespace Jack
case 's': //sync
if ( rx_head->fCycle == fTxHeader.fCycle )
return 0;
break;
}
}
}


+ 7
- 0
posix/JackPosixThread.cpp View File

@@ -261,6 +261,13 @@ void JackPosixThread::Terminate()
pthread_exit(0);
}

void ThreadExit()
{
jack_log("ThreadExit");
pthread_exit(0);
}


} // end of namespace

EXPORT bool jack_tls_allocate_key(jack_tls_key *key_ptr)


+ 2
- 1
posix/JackPosixThread.h View File

@@ -69,9 +69,10 @@ class EXPORT JackPosixThread : public detail::JackThreadInterface
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);

};

void ThreadExit();

} // end of namespace




+ 7
- 0
windows/JackWinThread.cpp View File

@@ -224,6 +224,13 @@ pthread_t JackWinThread::GetThreadID()

void JackWinThread::Terminate()
{
jack_log("JackWinThread::Terminate");
ExitThread(0);
}

void ThreadExit()
{
jack_log("ThreadExit");
ExitThread(0);
}



+ 2
- 0
windows/JackWinThread.h View File

@@ -71,6 +71,8 @@ class EXPORT JackWinThread : public detail::JackThreadInterface

};

void ThreadExit();

} // end of namespace

#endif


Loading…
Cancel
Save