[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Linphone-users] Bug in oRTP Version ortp-0.10.1
From: |
Simon Morlat |
Subject: |
Re: [Linphone-users] Bug in oRTP Version ortp-0.10.1 |
Date: |
Tue, 22 Aug 2006 13:48:43 +0200 |
User-agent: |
KMail/1.9.3 |
Le mardi 22 août 2006 04:02, Kannaiyan Natesan a écrit :
> Hi Simon,
>
> Thanks your kind reply.
>
> Receive is in a seperate Thread.
> Transmit is in a seperate Thread.
>
> session_destroy is in a seperate thread.
>
> WIth regardless of any condition I just called session_destroy, it must
> release the recv function right?
Clearly not.
When using the RtpSession api through several threads, you must implement your
own locking mechanism to ensure that no thread is using the RtpSession while
another one destroys it.
It's true for mostly all C/C++ libraries: for example in GTK you must not call
gtk_entry_get_text() while another thread is doing gtk_widget_destroy(). More
simply you must not do
char *mystring;
printf(mystring);
while another thread is doing free(mystring);
You must wait your recv thread to finish working with the RtpSession before
the other destroys the RtpSession.
Simon