Skip to content

Commit

Permalink
SBCCallLeg::onRTPStreamDestroy: use __pid_t for thread_id. use log_de…
Browse files Browse the repository at this point in the history
…mangled_stacktrace
  • Loading branch information
furmur committed Oct 19, 2023
1 parent c73e22e commit ce29171
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/SBCCallLeg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3697,8 +3697,9 @@ void SBCCallLeg::onAfterRTPRelay(AmRtpPacket* p, sockaddr_storage*)

void SBCCallLeg::onRTPStreamDestroy(AmRtpStream *stream) {
if(gettid() != thread_id) {
ERROR("onRTPStreamDestroy: another thread(%d) calls the leg instead thread(%d) that was created it", gettid(), thread_id);
log_stacktrace(L_ERR);
ERROR("called from the thread(%d) while owned by the thread(%d). ignore",
gettid(), thread_id);
log_demangled_stacktrace(L_ERR);
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/SBCCallLeg.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class SBCCallLeg : public CallLeg, public CredentialHolder
unsigned int sdp_session_offer_last_cseq;
unsigned int sdp_session_answer_last_cseq;
// for tests, thread id of session processor
pthread_t thread_id;
__pid_t thread_id;

string global_tag;

Expand Down

0 comments on commit ce29171

Please sign in to comment.