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:
Viktor Szakats
2009-06-15 18:45:17 +00:00
parent d3e965d9a2
commit c73804dc7a
4 changed files with 23 additions and 34 deletions

View File

@@ -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

View File

@@ -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();
}

View File

@@ -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

View File

@@ -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