Index: [thread] [date] [subject] [author]
  From: Marcus Sundberg <e94_msu@e.kth.se>
  To  : ggi-develop@eskimo.com
  Date: Fri, 17 Jul 1998 17:45:16 +0200

Re: triggered some probs with libAA-target

Jan Kneschke wrote:
> 
> On Fri, 17 Jul 1998, Marcus Sundberg wrote:
> > The problem is that you have to define MANSYNC_CHILD
> > or MANSYNC_PTHREAD before including ../common/mansync.in,
> > and thats not a recents change. It was made several
> > months ago by Steve Cheng, and it was clearly announced
> > on the mailinglist.
> 
> Aehm, MANSYNC_CHILD is define in aavisual.h which is included before
> ../common/mansync.inc in display/aa/mode.c . but the code in aa/mode.c and
> X/mode.c is different. let me show you:

[snip]

Doh, I forgot about that change. Ok, here's the deal with
mansync:
All targets that uses mansync.inc and have the possibility
that the application can ever open more than one visual
should adopt the mansync_hook_with_a_clashpreventing_name
scheme (but with a diffrent name obviously!)

All targets that uses mansync.inc and can only have one
visual per application open at a time should have a
global variable:

static int __GGI_<TARGETNAME>_inuse=0;

And at the top of GGIdlinit:

if (__GGI_<TARGETNAME>_inuse)
	return GGI_DL_ERROR;
__GGI_<TARGETNAME>_inuse++;

And at the end of GGIdlcleanup:

__GGI_<TARGETNAME>_inuse--;

Hmm. Maybe the mansync stuff should be global instead
of in every target? Or else it will be impossible to
open more than one target that uses mansync...

> here is the answer:
> 
> weigon@weigon:/linux2/home/weigon/degas/lib/libggi/display/aa > grep _mansync *.c
> mode.c:         _mansync_start(vis);
> mode.c:         _mansync_stop(vis);
> mode.c:         _mansync_ignore(vis);
> mode.c:         _mansync_cont(vis);
> visual.c:       _mansync_stop(vis);
> ^^^^^^^^^
> 
> can someone tell if this _mansync_stop is really needed ?? i'll try if
> everything works without this call in GGIdlcleanup.

Replace it with:

        /* prevents a soon-to-be unloaded function from being called */
        ggiSetFlags(vis, GGIFLAG_ASYNC);
        ggiFlush(vis);

It should do the same thing.

> is it really normal that a function is available in one object file only ??

If the function is static, yes.
And functions/global variables that are not part of the libggi
API should be declared static whereever possible.

//Marcus

Index: [thread] [date] [subject] [author]