Vishal Phirke wrote:
Ben,
The way it works is:
There is a mutex protected queue in which commands are enqueued and
dequeued. The mutexes are just to protects the main stack thread which
serves the queue and the application thread which enqueues the new commands
into the queue. The gCmdMutex is the one which does this. What's happening
in your case is, that the make call command is enqueued and the gCmdMutex is
released by the application thread. The command mutex is acquired by the
stack thread to process the MakeCall command and while doing so, still
acquiring gCmdMuex, the stack thread calls the startReceiveChannel callback.
Now if you have released your application mutex in MakeCall by this time,
this should go through and there shouldn't be a deadlock.
The 'start call' logic in my app needs to be protected from the callback logic,
so I'd rather not unlock before I call the 'makeCall' method. (The
interesting thing about programming with callbacks is you never really know
when they are going to be called, so the handlers for callbacks need to
be pretty paranoid about locking and checking state.)
As previously mentioned, I believe I'll remove the multi-threading
completely, but if you want to keep the locking, you might want to
consider changing your code to unlock the mutex queue immediately after
removing the message from the queue, and before making any callbacks.
That way, a call to a stack command will never deadlock, regardless of
the other locking in the system.
If you are interested in considering removing all locking and threading
entirely, I should have a patch that does this for ooh323c in a day
or two..
Also, while we're on the topic of me butchering your codebase (sorry! :)), I
also
would remove the ooCommon, ooSock* code from the media/* code and just
make it a regular shared library. That way, you don't have duplicated
socket code, and linking problems can be found at compile time instead
of runtime. Anyone wanting an application that has their own rtp stack
can simply link against something else and/or write their own.
Thanks!
Ben
--
Ben Greear <[EMAIL PROTECTED]>
Candela Technologies Inc http://www.candelatech.com
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
ooh323c-devel mailing list
ooh323c-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ooh323c-devel