2009-02-13 11:15 UTC+0100 Maurilio Longo (maurilio.longo@libero.it)

* harbour/include/hbthread.h
  * harbour/source/vm/thread.c
    ! fixed a bug on OS/2 MT implementation adding a new function,
      _hb_cond_timed_wait() because when a semaphore gets posted it has
      to be reset, otherwise it does not stop new threads entering it in a wait.
This commit is contained in:
Maurilio Longo
2009-02-13 10:18:28 +00:00
parent bdc6e81793
commit a05c032678
3 changed files with 21 additions and 2 deletions

View File

@@ -8,6 +8,13 @@
2009-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org)
*/
2009-02-13 11:15 UTC+0100 Maurilio Longo (maurilio.longo@libero.it)
* harbour/include/hbthread.h
* harbour/source/vm/thread.c
! fixed a bug on OS/2 MT implementation adding a new function,
_hb_cond_timed_wait() because when a semaphore gets posted it has
to be reset, otherwise it does not stop new threads entering it in a wait.
2009-02-13 11:08 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbpp.h
* harbour/source/pp/hbpp.c

View File

@@ -193,8 +193,8 @@ HB_EXTERN_BEGIN
# define HB_COND_DESTROY(v) DosCloseEventSem( v )
# define HB_COND_SIGNAL(v) DosPostEventSem( v )
# define HB_COND_SIGNALN(v,n) do { int i = (n); while( --i >= 0 ) DosPostEventSem( v ); } while(0)
# define HB_COND_WAIT(v) ( DosWaitEventSem( (v), SEM_INDEFINITE_WAIT ) == NO_ERROR )
# define HB_COND_TIMEDWAIT(v,n) ( DosWaitEventSem( (v), (n) ) == NO_ERROR )
# define HB_COND_WAIT(v) _hb_cond_timed_wait( (v), SEM_INDEFINITE_WAIT )
# define HB_COND_TIMEDWAIT(v,n) _hb_cond_timed_wait( (v), (n) )
# undef HB_COND_OS_SUPPORT
# define HB_CRITICAL_NEED_INIT

View File

@@ -185,6 +185,18 @@ void hb_threadExit( void )
}
#if defined( HB_OS_OS2 )
BOOL _hb_cond_timed_wait( HEV v, ULONG n )
{
ULONG ulPostCount = 0;
APIRET rc;
rc = DosWaitEventSem( v, n );
DosResetEventSem( v, &ulPostCount );
return rc == NO_ERROR;
}
ULONG _hb_gettid( void )
{
ULONG tid = 0;