diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 80fe2d18e7..a9cca8aedf 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,13 @@ The license applies to all entries newer than 2009-04-28. */ +2011-08-27 13:49 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbqt/hbmk2_qt.hbs + * contrib/hbqt/qtcore/hbqt.h + + Implemented: C level class creation is now thread-safe. + With this only pending issue with hbQT remains to replace + usage of strtok() function with Harbour's implementation. + 2011-08-27 13:09 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * INSTALL + added link to Cl*ipper 5.3. online docs (NG) on x-hacker.org diff --git a/harbour/contrib/hbqt/hbmk2_qt.hbs b/harbour/contrib/hbqt/hbmk2_qt.hbs index 62eefe353a..917e43b68a 100644 --- a/harbour/contrib/hbqt/hbmk2_qt.hbs +++ b/harbour/contrib/hbqt/hbmk2_qt.hbs @@ -1388,7 +1388,10 @@ METHOD HbQtSource:build() AAdd( aLine, "" ) AAdd( aLine, "static void s_registerMethods( HB_USHORT uiClass );" ) AAdd( aLine, "" ) - + AAdd( aLine, "static HB_CRITICAL_NEW( s_hbqtMtx );" ) + AAdd( aLine, "#define HB_HBQT_LOCK hb_threadEnterCriticalSection( &s_hbqtMtx );" ) + AAdd( aLine, "#define HB_HBQT_UNLOCK hb_threadLeaveCriticalSection( &s_hbqtMtx );" ) + AAdd( aLine, "" ) FOR EACH s IN ::hRef IF s:__enumKey() == "QList" /* TOFIX: Ugly hack */ tmp := s:__enumKey() + "< void * >" @@ -1580,6 +1583,7 @@ METHOD HbQtSource:build() AAdd( aLine, ' HB_TRACE( HB_TR_DEBUG, ( "HB_' + uQtObject +'" ) );' ) AAdd( aLine, " if( s_oClass == NULL )" ) AAdd( aLine, " {" ) + AAdd( aLine, " HB_HBQT_LOCK" ) AAdd( aLine, " s_oClass = hb_itemNew( NULL );" ) AAdd( aLine, " hbqt_addDeleteList( s_oClass );" ) FOR EACH k IN hb_aTokens( s, "," ) @@ -1591,6 +1595,7 @@ METHOD HbQtSource:build() AAdd( aLine, " s_registerMethods( hb_objGetClass( hb_stackReturnItem() ) );" ) AAdd( aLine, " hbqt_defineClassEnd( s_oClass, oClass );" ) AAdd( aLine, " }" ) + AAdd( aLine, " HB_HBQT_UNLOCK" ) AAdd( aLine, " return;" ) AAdd( aLine, " }" ) AAdd( aLine, ' hb_objSendMsg( s_oClass, "INSTANCE", 0 );' ) diff --git a/harbour/contrib/hbqt/qtcore/hbqt.h b/harbour/contrib/hbqt/qtcore/hbqt.h index 986738b708..d2cbe3626d 100644 --- a/harbour/contrib/hbqt/qtcore/hbqt.h +++ b/harbour/contrib/hbqt/qtcore/hbqt.h @@ -57,6 +57,7 @@ #include "hbapi.h" #include "hbapistr.h" +#include "hbthread.h" #if defined( HB_OS_OS2 ) # define OS2EMX_PLAIN_CHAR