From abfc488c1a8a3e98068efb01dc8a054737f002e9 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Sun, 12 Oct 2008 18:31:41 +0000 Subject: [PATCH] 2008-10-12 20:31 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/vm/hvm.c ! execute hb_vmThreadQuit() after hb_vmStackRelease() * harbour/source/vm/thread.c * do not destroy critical sections on exit --- harbour/ChangeLog | 7 +++++++ harbour/source/vm/hvm.c | 2 +- harbour/source/vm/thread.c | 23 +++-------------------- 3 files changed, 11 insertions(+), 21 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 63bf033448..359bdf045b 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,13 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2008-10-12 20:31 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/source/vm/hvm.c + ! execute hb_vmThreadQuit() after hb_vmStackRelease() + + * harbour/source/vm/thread.c + * do not destroy critical sections on exit + 2008-10-11 16:59 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * make_b32.mak * make_vc.mak diff --git a/harbour/source/vm/hvm.c b/harbour/source/vm/hvm.c index 09451b3a05..961e82acfc 100644 --- a/harbour/source/vm/hvm.c +++ b/harbour/source/vm/hvm.c @@ -1052,8 +1052,8 @@ HB_EXPORT int hb_vmQuit( void ) hb_gcCollectAll( TRUE ); #if defined( HB_MT_VM ) - hb_threadExit(); hb_vmStackRelease(); /* release HVM stack and remove it from linked HVM stacks list */ + hb_threadExit(); #else hb_setRelease( hb_stackSetStruct() ); /* releases Sets */ hb_stackFree(); diff --git a/harbour/source/vm/thread.c b/harbour/source/vm/thread.c index 2b4e31115a..e3f9a18741 100644 --- a/harbour/source/vm/thread.c +++ b/harbour/source/vm/thread.c @@ -175,27 +175,10 @@ void hb_threadInit( void ) void hb_threadExit( void ) { - if( s_fThreadInit ) + if( s_pOnceMutex ) { - s_fThreadInit = FALSE; - if( s_pOnceMutex ) - { - hb_itemRelease( s_pOnceMutex ); - s_pOnceMutex = NULL; - } -#if !defined( HB_MT_VM ) - /* nothing to do */ -#else -# if defined( HB_CRITICAL_DESTROY ) && defined( HB_CRITICAL_NEED_INIT ) - HB_CRITICAL_DESTROY( s_init_mtx ); - HB_CRITICAL_DESTROY( s_once_mtx ); - HB_CRITICAL_DESTROY( s_thread_mtx ); - HB_CRITICAL_DESTROY( s_mutexlst_mtx ); -# endif -# if defined( HB_COND_DESTROY ) && defined( HB_COND_NEED_INIT ) - HB_COND_DESTROY( s_thread_cond ); -# endif -#endif + hb_itemRelease( s_pOnceMutex ); + s_pOnceMutex = NULL; } }