[Harbour] Are there MT issues in contrib/hbpgsql?
Lorenzo Fiorini
lorenzo.fiorini at gmail.com
Wed Feb 3 11:29:07 EST 2010
2010/2/3 Przemysław Czerpak <druzus at acn.waw.pl>:
> You are freeing directly or indirectly HRB module which is currently
> executed. HRB modules are unloaded automatically when all references to
> pHRB variable returned by hb_hrbLoad() are cleared.
> Fix you code to keep HRB module alive as long as it is used.
Here is the code that run the hrb
...
hb_threadDetach( hb_threadStart( @processcall(), Self, nSocket ) )
...
function processcall( oServer, nSocket )
...
local pHRB, xResult
...
elseif cExt == ".hrb"
cBinFile := oServer:cBinRoot + cName + cExt
if !file( cBinFile )
oResponse:Flush( 404, "Not found", "text/html", "404 File: "
+ cBinFile + " not found" )
else
begin sequence with { |e| logerror( e, oResponse, cBinFile ) }
if !empty( pHRB := hb_hrbload( cBinFile ) )
xResult := hrbmain()
if ISCHARACTER( xResult )
oResponse:Flush( 200, "OK",, xResult )
endif
endif
always
if !empty( pHRB )
hb_hrbunload( pHRB )
endif
endsequence
endif
...
Any suggestion?
best regards,
Lorenzo
More information about the Harbour
mailing list