On Tue, 11 Nov 2008, Maurilio Longo wrote:

Hi Maurilio,

> I don't know, but I remember that I started working on harbour for OS/2
> exactly for the same problem, sometimes it was GPFing without reason and I
> traced that reason to two things:
> 1) KBD code not using tiled memory
> 2) gtos2.c code calling video functions (VioXXX) and not using tiled memory.
> You need to use tiled memory because OS/2 drivers are 16 bit protected memory
> code and I think that, maybe, OW code does not respect this requirement.

Do not forget that it works for 1-st thread. Only other threads cannot
executr KbdCharIn().

> > Why we have s_hk which is only low memory block initialized to NULL?
> > This code efectively works like:
> >    KbdCharIn( s_key, IO_NOWAIT, NULL );
> Uhm, I'm not sure, but I think that since it has to receive a pointer to a
> tiled memory area, this was to be sure that the memory was really tiled.

OK I understand the reasons why it was introduced but inside s_hk we have
NULL pointer so '( HKBD ) * s_hk' extracts NULL and this NULL value is
passed as 3-rd parameter of KbdCharIn():
   KbdCharIn( s_key, IO_NOWAIT, ( HKBD ) * s_hk );
It means that s_hk does nothing in all OS2 builds and can be eliminated.
Maybe allocating some keyboard handler (KbdOpen()) and assigning it to this
variable can resolve the problem with calling KbdCharIn() by non 1-st thread.
BTW. In Harbour access to GT is mutual exclusive so we do not have to worry
about executing this function by more then one thread simultaneously.

Thank you for your help.

best regards,
Przemek
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to