<div dir="ltr">Hi Michael<div>I has created modified version of switch_load_timezones function in attached file.</div><div>I has make first step - "<span style="font-size:12.8000001907349px">swap out the pointers", but do know not how to make correctly thread synchronization. Can you give me reference to function and source file where located mutex protection </span><span style="font-size:12.8000001907349px">of </span><span style="font-size:12.8000001907349px">dialplan reload?</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">I has read apr_thread_mutex_lock and apr_thread_rwlock_rdlock functions description</span></div><div><span style="font-size:12.8000001907349px">apr_thread_mutex_lock </span><span style="font-size:12.8000001907349px"><a href="http://apr.apache.org/docs/apr/1.3/group__apr__thread__mutex.html#g1430fd10d8d260c0e3832c959742a977">http://apr.apache.org/docs/apr/1.3/group__apr__thread__mutex.html#g1430fd10d8d260c0e3832c959742a977</a></span><br></div><div><span style="font-size:12.8000001907349px">apr_thread_rwlock_rdlock </span><span style="font-size:12.8000001907349px"><a href="http://apr.apache.org/docs/apr/1.4/group__apr__thread__rwlock.html#gad44a106cd9a81eef362d31837ca7018f">http://apr.apache.org/docs/apr/1.4/group__apr__thread__rwlock.html#gad44a106cd9a81eef362d31837ca7018f</a></span><br></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">May be usage switch_thread_rwlock_t datatype and switch_thread_rwlock_rdlock function will be more featured? This allow multiple threads make switch_lookup_timezone.</span></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 3, 2015 at 10:20 PM, Michael Jerris <span dir="ltr"><<a href="mailto:mike@jerris.com" target="_blank">mike@jerris.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">yes it will require code changes there. I wouldn't make an idle loop tho. I would do something to swap out the pointers with the new ones and protect it all with a mutex. I think we do something similar with dialplan reload.<span class=""><div><br><div><br><div><blockquote type="cite"><div>On Mar 3, 2015, at 1:35 PM, Sergey Safarov <<a href="mailto:s.safarov@gmail.com" target="_blank">s.safarov@gmail.com</a>> wrote:</div><br><div><div dir="ltr"><div>Will it help addition of the configuration update flag of module <span style="font-size:12.8000001907349px">CORE_SOFTTIMER_MODULE</span>.</div><div>And to add idle loop 'into the function switch_lookup_timezone until 'update is complete?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 3, 2015 at 7:21 PM, Michael Jerris <span dir="ltr"><<a href="mailto:mike@jerris.com" target="_blank">mike@jerris.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">That is ALWAYS loaded before any other modules, so that not being loaded after. Whats happening here, is the reload signal triggers the timezones to reload asynchronously. This will require a code change to swap those out in some way that doesn't leave them empty for a short period, properly protected against race conditions. This code is in switch_time.c.<br>
<div><div><br>
<br>
> On Mar 3, 2015, at 10:41 AM, Sergey Safarov <<a href="mailto:s.safarov@gmail.com" target="_blank">s.safarov@gmail.com</a>> wrote:<br>
><br>
> Please help me declare module dependency<br>
> I has extended module radius_cdr by timezone support and from time to time is getting following error<br>
><br>
> freeswitch@internal> reload mod_radius_cdr<br>
> +OK Reloading XML<br>
> +OK module unloaded<br>
> +OK module loaded<br>
><br>
> 2015-03-03 18:35:34.543407 [CONSOLE] switch_loadable_module.c:1935 Stopping: mod_radius_cdr<br>
> 2015-03-03 18:35:34.543407 [CONSOLE] switch_loadable_module.c:1955 mod_radius_cdr unloaded.<br>
> 2015-03-03 18:35:34.543407 [INFO] mod_enum.c:880 ENUM Reloaded<br>
> 2015-03-03 18:35:34.543407 [ERR] switch_time.c:1324 Timezone 'Asia/Tokyo' not found!<br>
> 2015-03-03 18:35:34.543407 [ERR] mod_radius_cdr.c:992 Cannot find timezone Asia/Tokyo<br>
> , Setting timezone to GMT<br>
> 2015-03-03 18:35:34.543407 [CONSOLE] switch_loadable_module.c:1465 Successfully Loaded [mod_radius_cdr]<br>
> 2015-03-03 18:35:34.543407 [INFO] switch_time.c:1369 Timezone reloaded 1781 definitions<br>
><br>
><br>
> Module currently depend of loaded configuradion of CORE_SOFTTIMER_MODULE but mod_radius_cdr loaded before loaded CORE_SOFTTIMER_MODULE configuration.<br>
><br>
> How can I make sure that CORE_SOFTTIMER_MODULE configuration is loaded before mod_radius_cdr?<br>
<br></div></div></blockquote></div></div></div></blockquote></div><br></div></div></span></div><br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" target="_blank">http://confluence.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br></blockquote></div><br></div>