threads timeout

mod_harbour is an Apache module that allows to run PRGs directly on the web !!!

threads timeout

Postby Antonio Linares » Tue Feb 18, 2020 6:29 am

live demo:
https://fivetechsoft.github.io/snippets?20200218110744

Code: Select all  Expand view
function Main()

   local pThread
   
   pThread =  hb_threadStart( @Test() )

   if hb_threadWait( pThread, 5 ) != 1   // We wait 5 seconds
      hb_threadQuitRequest( pThread )
   endif

   hb_threadWaitForAll()

   ? "ok"

return nil

function Test()

   ErrorBlock( { | oError | AP_RPuts( "errorblock" ), Break( oError ) } )

   ? hb_Compiler()
   
   while .T.    // endless loop to block the thread
   end
   
return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Return to mod_harbour

Who is online

Users browsing this forum: No registered users and 8 guests