Re: [Harbour] if ( hb_threadMutexLock( s_pMtx ) ) - Clarification

2008-10-27 Thread Przemyslaw Czerpak
On Mon, 27 Oct 2008, Pritpal Bedi wrote: Hi Pritpal, > One more question, > under what circumstances deadlocks may occur? When you create code which can cause such situation, f.e.: static s_mtx1, s_mtx2 init proc initmtx s_mtx1 := hb_mutexCreate() s_mtx2 := hb_mutexCreate()

Re: [Harbour] if ( hb_threadMutexLock( s_pMtx ) ) - Clarification

2008-10-27 Thread Pritpal Bedi
Got it, thanks. One more question, under what circumstances deadlocks may occur? Regards Pritpal Bedi Przemyslaw Czerpak-2 wrote: > > It waits but can be interrupted, f.e. by HVM crash, main > thread QUIT statement or deadlock detection. Now we do not > have our own deadlock detection system

Re: [Harbour] if ( hb_threadMutexLock( s_pMtx ) ) - Clarification

2008-10-27 Thread Przemyslaw Czerpak
On Mon, 27 Oct 2008, Pritpal Bedi wrote: Hi Pritpal, > Here is a curosity: > if ( hb_threadMutexLock( s_pMtx ) ) > { >... >... >hb_threadMutexUnlock( s_pMtx ); > } > Does this function waits for the lock until > obtained or returns immediately? It waits but can be interrupted, f.e.

[Harbour] if ( hb_threadMutexLock( s_pMtx ) ) - Clarification

2008-10-27 Thread Pritpal Bedi
Przemek Here is a curosity: if ( hb_threadMutexLock( s_pMtx ) ) { ... ... hb_threadMutexUnlock( s_pMtx ); } Does this function waits for the lock until obtained or returns immediately? If it waits until lock is obtained, then why we should use 'if' statement? Regards Pritpal Bedi --