Ok... So if I correctly understand, I can in a external module made in C (like for exemple a Pext) call a non thread-safe function without make a Mutex lock ?
Yes, as long as you don't release the interpreter lock.
and maybe the following code in src/modules/Msql/msqlmod.c is not really needed :
THREADS_ALLOW(); MSQL_LOCK(); status=msqlReloadAcls(socket); MSQL_UNLOCK(); THREADS_DISALLOW();
The above construction increases the lock granularity.
/ Henrik Grubbström (Lysator)
Previous text:
2003-06-17 23:53: Subject: Re: Pike localtime(), threads safe and low level localtime() / localtime_r() ?
Le mardi, 17 jun 2003, à 23:40 Europe/Paris, David Hedbor @ Pike developers forum a écrit :
Thank you for this usefull information..
But is seems that is valid only in the core of Pike, since src/modules/Msql/*.c has such options THREADS_ALLOW and its friends THREADS_DISALLOW
/Xavier
I don't quite understand what you mean with this. What I said is always true in any C-method called from Pike, regardless if it's in a "core" method or a method in a dynamically loaded module.
Ok... So if I correctly understand, I can in a external module made in C (like for exemple a Pext) call a non thread-safe function without make a Mutex lock ?
If so... I just say wow !
and maybe the following code in src/modules/Msql/msqlmod.c is not really needed :
THREADS_ALLOW(); MSQL_LOCK(); status=msqlReloadAcls(socket); MSQL_UNLOCK(); THREADS_DISALLOW();
/Xavier
/ Brevbäraren