No,
even changhing it this way:
dlmalloc.c[1452] onward
#if /*defined( HB_OS_OS2 ) ||*/ defined( HB_OS_WIN ) || defined( __WATCOMC__ )
# ifndef HB_SPINLOCK_USE
# define HB_SPINLOCK_USE
# endif
#endif
#ifdef HB_SPINLOCK_USE
# include "hbthread.h"
# include "hbatomic.h"
#endif
#ifndef HB_SPINLOCK_T
# undef HB_SPINLOCK_USE
#endif
#ifdef HB_SPINLOCK_USE
static int spin_acquire_lock( HB_SPINLOCK_T *l )
{
HB_SPINLOCK_ACQUIRE( l );
return 0;
}
#define MLOCK_T HB_SPINLOCK_T
#define INITIAL_LOCK(l) *(l)=HB_SPINLOCK_INIT
#define ACQUIRE_LOCK(l) spin_acquire_lock(l)
#define RELEASE_LOCK(l) HB_SPINLOCK_RELEASE(l)
#define MLOCK_INIT HB_SPINLOCK_INIT
#elif defined( HB_OS_OS2 )
#include "hbthread.h"
#include "hbatomic.h"
#define MLOCK_T HB_RAWCRITICAL_T
#define INITIAL_LOCK(l) HB_CRITICAL_INIT(*(l))
#define ACQUIRE_LOCK(l) HB_CRITICAL_LOCK(*(l))
#define RELEASE_LOCK(l) HB_CRITICAL_UNLOCK(*(l))
#define MLOCK_INIT { 0 }
did not solve the problem and hbmk2 dies as soon as it is called.
Maurilio
Maurilio Longo wrote:
> Przemyslaw,
>
> dlmalloc[1452], HB_SPINLOCK_USE is set.
>
> I'll try using OS/2 section to see if it works.
>
> Maurilio.
>
>
> Przemysław Czerpak wrote:
>> On Tue, 24 Nov 2009, Maurilio Longo wrote:
>>
>> Hi,
>>
>>> hbmk2 fails with an exception inside harbourm.dll.
>>> hbtest and hbrun, instead, work flawlessly.
>>> What can it be?
>> Only HBMK2 uses MT HVM so probably code for MT locks inside
>> DLMALLOC in OS2 builds is broken. It should be easy to fix it.
>> Depending on available atomic macros one of two versions is used,
>> see dlmalloc[1467]
>>
>> #ifdef HB_SPINLOCK_USE
>>
>> static int spin_acquire_lock( HB_SPINLOCK_T *l )
>> {
>> HB_SPINLOCK_ACQUIRE( l );
>> return 0;
>> }
>>
>> #define MLOCK_T HB_SPINLOCK_T
>> #define INITIAL_LOCK(l) *(l)=HB_SPINLOCK_INIT
>> #define ACQUIRE_LOCK(l) spin_acquire_lock(l)
>> #define RELEASE_LOCK(l) HB_SPINLOCK_RELEASE(l)
>> #define MLOCK_INIT HB_SPINLOCK_INIT
>>
>> #elif defined( HB_OS_OS2 )
>>
>> #define MLOCK_T HB_RAWCRITICAL_T
>> #define INITIAL_LOCK(l) HB_CRITICAL_INIT(*(l))
>> #define ACQUIRE_LOCK(l) HB_CRITICAL_LOCK(*(l))
>> #define RELEASE_LOCK(l) HB_CRITICAL_UNLOCK(*(l))
>> #define MLOCK_INIT { 0 }
>>
>> #elif !defined( WIN32 )
>>
>>
>> If you are using o...@x86 and GCC then the first version (HB_SPINLOCK_USE)
>> should be enabled. This code is used also on other platforms so it should
>> work without any problems so maybe in OS2 builds HB_CPU_X86 is not set
>> (BTW I'll commit some minor modification to the code which sets this macro
>> in a while). The second version inside HB_OS_OS2 section is not tested at
>> all and it's highly possible that it does not work. Can you check which
>> version is used in your build?
>> Just simply add:
>> int version_HB_SPINLOCK_USE;
>> and:
>> int version_HB_OS_OS2;
>> to above code and check which variable will be reported as unused.
>>
>> best regards,
>> Przemek
>> _______________________________________________
>> Harbour mailing list (attachment size limit: 40KB)
>> [email protected]
>> http://lists.harbour-project.org/mailman/listinfo/harbour
>>
>
--
__________
| | | |__| Maurilio Longo
|_|_|_|____| farmaconsult s.r.l.
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour