2009-06-15 20:44 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* include/hbextern.ch
* source/vm/thread.c
+ Added HB_MUTEXWAITERSCOUNT() to core.
(slightly rewritten using local functions)
- examples/uhttpd2/umutex.c
- No longer needed.
This commit is contained in:
@@ -17,6 +17,15 @@
|
||||
past entries belonging to author(s): Viktor Szakats.
|
||||
*/
|
||||
|
||||
2009-06-15 20:44 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* include/hbextern.ch
|
||||
* source/vm/thread.c
|
||||
+ Added HB_MUTEXWAITERSCOUNT() to core.
|
||||
(slightly rewritten using local functions)
|
||||
|
||||
- examples/uhttpd2/umutex.c
|
||||
- No longer needed.
|
||||
|
||||
2009-06-15 20:37 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* examples/uhttpd2/uwidgets.prg
|
||||
* examples/uhttpd2/uhbext.prg
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include "hbapi.h"
|
||||
#include "hbapiitm.h"
|
||||
#include "hbthread.h"
|
||||
|
||||
typedef struct _HB_MUTEX
|
||||
{
|
||||
int lock_count;
|
||||
int lockers;
|
||||
int waiters;
|
||||
PHB_ITEM events;
|
||||
HB_THREAD_ID owner;
|
||||
HB_RAWCRITICAL_T mutex;
|
||||
HB_RAWCOND_T cond_l;
|
||||
HB_RAWCOND_T cond_w;
|
||||
BOOL fSync;
|
||||
struct _HB_MUTEX * pNext;
|
||||
struct _HB_MUTEX * pPrev;
|
||||
}
|
||||
HB_MUTEX, * PHB_MUTEX;
|
||||
|
||||
|
||||
HB_FUNC( HB_MUTEXWAITERSCOUNT )
|
||||
{
|
||||
PHB_MUTEX pItem = ( PHB_MUTEX ) hb_param( 1, HB_IT_POINTER );
|
||||
|
||||
if( pItem )
|
||||
hb_retni( ( ( PHB_MUTEX ) hb_itemGetPtr( pItem ) )->waiters );
|
||||
else
|
||||
hb_ret();
|
||||
}
|
||||
@@ -1015,6 +1015,7 @@ EXTERNAL HB_MUTEXNOTIFY
|
||||
EXTERNAL HB_MUTEXNOTIFYALL
|
||||
EXTERNAL HB_MUTEXSUBSCRIBE
|
||||
EXTERNAL HB_MUTEXSUBSCRIBENOW
|
||||
EXTERNAL HB_MUTEXWAITERSCOUNT
|
||||
|
||||
/* Codepage support */
|
||||
EXTERNAL HB_CODEPAGE_BG866
|
||||
|
||||
@@ -2318,6 +2318,19 @@ HB_FUNC( HB_MUTEXSUBSCRIBENOW )
|
||||
}
|
||||
}
|
||||
|
||||
HB_FUNC( HB_MUTEXWAITERSCOUNT )
|
||||
{
|
||||
PHB_ITEM pItem = hb_mutexParam( 1 );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
PHB_MUTEX pMutex = hb_mutexPtr( pItem );
|
||||
|
||||
if( pMutex )
|
||||
hb_retni( pMutex->waiters );
|
||||
}
|
||||
}
|
||||
|
||||
HB_FUNC( HB_MTVM )
|
||||
{
|
||||
HB_STACK_TLS_PRELOAD
|
||||
|
||||
Reference in New Issue
Block a user