>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.

Error happen

To see something I added last tracing label

-------------------------
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;
         printf( "ptib->tib_ptib2->tib2_ultid\r\n" ); fflush(stdout);
   }

   return tid;
}
-------------------------


Using -bm flag and hbvmmt

-----------------
ptib->tib_ptib2->tib2_ultid
ptib->tib_ptib2->tib2_ultid
ptib->tib_ptib2->tib2_ultid
ptib->tib_ptib2->tib2_ultid
ptib->tib_ptib2->tib2_ultid
ptib->tib_ptib2->tib2_ultid
ptib->tib_ptib2->tib2_ultid
ptib->tib_ptib2->tib2_ultid
ptib->tib_ptib2->tib2_ultid
SYS1808:
The process has stopped.  The software diagnostic
code (exception code) is  0001.
-----------------


And what alternative exist if this is .F., returning tid=0 ?

   if( DosGetInfoBlocks( &ptib, NULL ) == NO_ERROR )


David Macias
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to