Re: [AD] Mini-synchronization API proposal for 4.1.x

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On March 24, 2002 03:08 am, you wrote:
[snip]
>
> > Also, if you disable threads in the Unix port and use SIGALRM instead,
> > should:
> >
> > (a) AL_MUTEXes do nothing (because callbacks are then "atomic", so no
> > synchronisation required)
> >
> > (b) AL_MUTEXes do ... something else?
> >
> > I guess (a).
>
> Yes, I think (a) is the best solution.

hmm.. ok. 

void handler(void)
{
  al_mutex_lock(my_mutex);
  my_value = 0;
  al_mutex_unlock(my_mutex);
}

int main()
{
  al_mutex_lock(my_mutex);
  /* handler called here */
  if(my_value) do something;
  al_mutex_unlock(my_mutex);

  ...
}


if mutexes do nothing then wouldn't that be a bit odd? how would that be 
handled? (can't wait in the handler...)

> > I think you need to move AL_MUTEX out of mutex.inl.  I don't know
> > where, so I'll leave it to you.
>
> system.h ?

-- 
Thomas Fjellstrom
tfjellstrom@xxxxxxxxxx
http://strangesoft.net



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/