On Sat, 08 Nov 2008, David Arturo Macias Corona wrote:

Hi David,

> >So it will crashes inside hb_vmExecute()
> >Please try to commenct line 1127 in hvm.c
> >         hb_inkeyPoll();
> >to eliminate yet another possibly danger place and make test.
> I commented in hvm.c two active
>   hb_inkeyPoll();
> and error has gone

And we've got a reason. I expected that it will be exploited earlier
by hb_gtAttach() but I forgot that when GT is inherited attaching is
done without locks.
Looks that it fails inside _hb_gettid() when it's executed from non
main thread but I only guess now.
Please restore original hvm.c and thread.c code and then change in
thread.c function _hb_gettid() to the code below.

best regards,
Przemek


ULONG _hb_gettid( void )
{
   ULONG tid = 0;
   PTIB  ptib = NULL;

   if( DosGetInfoBlocks( &ptib, NULL ) == NO_ERROR )
   {
      if( ! ptib )
         { printf( "ptib is NULL\r\n" ); fflush(stdout); }
      else if( !ptib->tib_ptib2 )
         { printf( "ptib->tib_ptib2 is NULL\r\n" ); fflush(stdout); }
      else
         tid = ptib->tib_ptib2->tib2_ultid;
   }

   return tid;
}
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to