On Tue, 11 Nov 2008, Pritpal Bedi wrote: Hi Pritpal,
> May be I could not present my case properly. > I understand your implementation of new GT and also > how it is behaving. My request is based on the new OBJECT > modal I am building on lines with Xbase++ where I needed > such functionality. > I only need GTINFO manipulation is such way nothing else. If it resolves your problem locally then simply add such function to your code. IMHO it will not help and if you have such problem now then you will have it with new code though maybe exploited in different place. > static BOOL hb_gt_wvt_Info( PHB_GT pGTx, int iType, PHB_GT_INFO pInfo ) // > initial change > { > PHB_GT pGT = NULL; > PHB_GTWVT pWVT; > int iVal; > > HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvt_Info(%p,%d,%p)", pGT, iType, pInfo ) > ); > > if( pInfo->pGT && hb_itemType( pInfo->pGT ) & HB_IT_POINTER ) > { > pGT = hb_gt_ItemBase( pInfo->pGT ); > if( pGT ) > hb_gt_BaseFree( pGT ); > else > pGT = pGTx; > } > if( !pGT ) > { > pGT = pGTx; > } When you are writing OOP code do ypu plan to pass SELF as 1-st parameter and then you are making sth like: IF SELF == NIL SELF := QSelf() ENDIF ??? > Above changes does not disturb current GT implementation. I Don't you see that it breaks GT locking? After: hb_gt_BaseFree( pGT ); pGT is not locked and other threads can make some operation on it when you are still using it in you INFO() method? > have tested extensively with both GTWVT and GTWVG. Instead > it empowers me to manipulate GTs running in different threads > from current thread. I have some interesting usage in place > and hopefully by ths weekend I be able to upload partial but > working xbase++ cmpatible class structure in GTWVG, pure console. > If agreed let me know if I can commit above changes. 1-st it's wrong. 2-nd for me you more or less intentionally found a workaround for some problem in your code which is probably resolved by removing GT mutex protection. The problem will still exist in your codeand the above will not help you if we fixed the code to keep protection. 3-rd other people which will have to work on GT code will kill us when they discover that pGT context can be replaced inside executed method ;-) Below is full hb_gtInfoeEx() implementation in C. It does not switch GT context and it has working GT locking. Use it locally in your code. Maybe it will help you to locate the problem which is in your code. Probably deadlock. Or maybe it will work for you as you want. Best regards, Przemek HB_FUNC( HB_GTINFO ) { if( ISPOINTER( 1 ) && ISNUM( 2 ) ) { PHB_GT pGT = hb_gt_ItemBase( hb_param( 1, HB_IT_ANY ) ); if( pGT ) { HB_GT_INFO gtInfo; gtInfo.pNewVal = hb_param( 3, HB_IT_ANY ); gtInfo.pNewVal2 = hb_param( 4, HB_IT_ANY ); gtInfo.pResult = NULL; HB_GTSELF_INFO( pGT, hb_parni( 2 ), >Info ); hb_gt_BaseFree( pGT ); if( gtInfo.pResult ) hb_itemReturnRelease( gtInfo.pResult ); } } else hb_errRT_BASE_SubstR( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } _______________________________________________ Harbour mailing list Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour