2011-03-08 09:44 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/include/hbvm.h
  * harbour/src/vm/hvm.c
    * added new public C function:
         HB_BOOL hb_vmRequestReenterExt( void );
      hb_vmRequestReenterExt() checks if given thread has registered HVM
      stack and if not it creates new one otherwise it makes the same
      operations as hb_vmRequestReenter(). It should be also used with
      hb_vmRequestRestore() which checks if new stack was allocated and
      if yes then it releases it.
      For ST HVM hb_vmRequestReenterExt() works exactly like
      hb_vmRequestReenter().

  * harbour/include/hbthread.h
    ! typo in comment

  * harbour/contrib/hbwin/win_svc.c
    ! fixed to work with MT HVM
    + accept function symbol (@func()) as 2-nd parameter of
      WIN_SERVICESTART() function
    * replaced one HB_TCHAR_*() function by Harbour STR API one.
      (for full UNICODE support we should eliminate all HB_TCHAR_*()
      functions)
This commit is contained in:
Przemyslaw Czerpak
2011-03-08 08:45:00 +00:00
parent 11d87204c3
commit d8ee19c19b
5 changed files with 96 additions and 22 deletions

View File

@@ -8693,17 +8693,53 @@ void hb_vmRequestRestore( void )
uiAction = ( HB_USHORT ) hb_stackItemFromTop( -1 )->item.asInteger.value |
hb_stackGetActionRequest();
if( uiAction & HB_QUIT_REQUESTED )
hb_stackSetActionRequest( HB_QUIT_REQUESTED );
else if( uiAction & HB_BREAK_REQUESTED )
hb_stackSetActionRequest( HB_BREAK_REQUESTED );
else if( uiAction & HB_ENDPROC_REQUESTED )
hb_stackSetActionRequest( HB_ENDPROC_REQUESTED );
else
hb_stackSetActionRequest( 0 );
hb_stackDec();
hb_stackPopReturn();
#if defined( HB_MT_VM )
if( uiAction & HB_VMSTACK_REQUESTED )
hb_vmThreadQuit();
else
#endif
{
if( uiAction & HB_QUIT_REQUESTED )
hb_stackSetActionRequest( HB_QUIT_REQUESTED );
else if( uiAction & HB_BREAK_REQUESTED )
hb_stackSetActionRequest( HB_BREAK_REQUESTED );
else if( uiAction & HB_ENDPROC_REQUESTED )
hb_stackSetActionRequest( HB_ENDPROC_REQUESTED );
else
hb_stackSetActionRequest( 0 );
hb_stackDec();
hb_stackPopReturn();
}
}
HB_BOOL hb_vmRequestReenterExt( void )
{
HB_TRACE(HB_TR_DEBUG, ("hb_vmRequestReenterExt()"));
if( !s_fHVMActive )
return HB_FALSE;
#if defined( HB_MT_VM )
{
HB_STACK_TLS_PRELOAD
HB_USHORT uiAction = hb_stackId() == NULL ? HB_VMSTACK_REQUESTED : 0;
if( uiAction )
hb_vmThreadInit( NULL );
else
hb_stackPushReturn();
hb_vmPushInteger( uiAction | hb_stackGetActionRequest() );
}
#else
hb_stackPushReturn();
hb_vmPushInteger( hb_stackGetActionRequest() );
hb_stackSetActionRequest( 0 );
#endif
return HB_TRUE;
}
HB_BOOL hb_vmIsActive( void )