[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: User interaction from multiple threads

From: Michael Albinus
Subject: Re: User interaction from multiple threads
Date: Sat, 25 Aug 2018 13:58:54 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Elias Mårtenson <address@hidden> writes:

Hi Elias,

> May I propose that the murex be hidden behind a function and a macro?
> The purpose of this would be to allow for the function to adviced by
> libraries that want to do something special. Something like this:
> (defmacro with-prompt-interaction (&body body)
>   (call-with-prompt-interaction `(lambda ()  ,@body)))
> (defun call-with-prompt-interaction (fn)
>   (with-mutex (interaction-mutex)
>     (funcall fn)))
> This would allow advices to be applied to the
> call-with-prompt-interaction function.

But then you must force everybody to use the
`call-with-prompt-interaction' function. Doesn't it suffice to advice
`mutex-lock' and `mutex-unlock'? In your advice code you could check,
whether MUTEX is equal to `interaction-mutex'.

> Regards,
> Elias

Best regards, Michael.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]