Re: Shutdown races...

Alexander Malysh <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
Hi,

1) it's not a whole patch
2) it's more a hack as solution

Kannel _must_ work out of the box and if there are races then pls 
provide backtrace and debug log so that should be fixed. I need to go 
through my tree to see if I forgot anything to merge...

Thanks,
Alex

Wilfried Goesgens schrieb:
> On Wed, Apr 19, 2006 at 12:37:43PM +0200, Alexander Malysh wrote:
>> Hi,
>>
>> this patch is also wrong. see below...
>>> +        conn = gwlist_get(smsc_list, i);
>>> +		smscconn_wait_shutdown_finished(conn);
>> I don't know any function with such name...
>>
>>> +		info(0,"%li done. %li more to go.", i, j-i);
> 
> sorry, forgot that one. 
> 
> Wilfried G�sgens
> 
> 
> 
> ------------------------------------------------------------------------
> 
> --- a/gateway/gw/smscconn.c	2006-04-18 21:01:30.000000000 +0200
> +++ b/gateway/gw/smscconn.c	2006-04-05 18:16:59.000000000 +0200
> @@ -289,6 +288,19 @@
>  }
>  
>  
> +void smscconn_wait_shutdown_finished(SMSCConn *conn)
> +{
> +    gw_assert(conn != NULL);
> +    mutex_lock(conn->flow_mutex);
> +	while (conn->status != SMSCCONN_DEAD) {
> +		mutex_unlock(conn->flow_mutex);
> +		gwthread_sleep(0.1);
> +		mutex_lock(conn->flow_mutex);
> +    }
> +	mutex_unlock(conn->flow_mutex);
> +	return;
> +}
> +
>  void smscconn_shutdown(SMSCConn *conn, int finish_sending)
>  {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.