Browse Source

fix compare to process thread id. in jack_session_reply()

tags/1.9.7
Torben Hohn 16 years ago
parent
commit
2748fd33ba
4 changed files with 19 additions and 1 deletions
  1. +3
    -0
      common/JackChannel.h
  2. +12
    -1
      common/JackClient.cpp
  3. +2
    -0
      common/JackEngine.cpp
  4. +2
    -0
      posix/JackSocketClientChannel.h

+ 3
- 0
common/JackChannel.h View File

@@ -132,6 +132,9 @@ class JackClientChannelInterface

virtual void SessionReply(int refnum, int *result)
{}

virtual bool IsChannelThread()
{ return false; }
};

}


+ 12
- 1
common/JackClient.cpp View File

@@ -285,7 +285,14 @@ int JackClient::ClientNotify(int refnum, const char* name, int notify, int sync,
snprintf( uuid_buf, sizeof(uuid_buf), "%d", GetClientControl()->fSessionID );
event->client_uuid = strdup( uuid_buf );

fImmediateSessionReply = false;

fSession(event, fSessionArg);

if (fImmediateSessionReply)
res = 1;
else
res = 2;
}
break;
}
@@ -1088,11 +1095,15 @@ int JackClient::SessionReply( jack_session_event_t *ev )

GetClientControl()->fSessionFlags = ev->flags;

if (fThread.IsThread()) {
jack_log( "JackClient::SessionReply... we are here" );
if (fChannel->IsChannelThread()) {
jack_log( "JackClient::SessionReply... in callback reply" );
fImmediateSessionReply = true;
return 0;
}

jack_log( "JackClient::SessionReply... out of cb" );

int res;
fChannel->SessionReply( GetClientControl()->fRefNum, &res);
return res;


+ 2
- 0
common/JackEngine.cpp View File

@@ -890,6 +890,8 @@ void JackEngine::SessionNotify(int refnum, const char *target, jack_session_even

jack_log("JackEngine::SessionNotify ... sending");
int result = client->ClientNotify(i, client->GetClientControl()->fName, kSessionCallback, true, path, (int) type, 0);
jack_log("JackEngine::SessionNotify ... got reply: %d", result);

if (result == 2) {
fSessionPendingReplies += 1;
} else if (result == 1) {


+ 2
- 0
posix/JackSocketClientChannel.h View File

@@ -97,6 +97,8 @@ class JackSocketClientChannel : public detail::JackClientChannelInterface, publi

void SessionNotify(int refnum, const char* target, jack_session_event_type_t type, const char* path, jack_session_command_t** result);
void SessionReply(int refnum, int* result);

bool IsChannelThread() { return fThread.IsThread(); }
};

} // end of namespace


Loading…
Cancel
Save