[Ecls-list] Query about changes
Juan Jose Garcia-Ripoll
juanjose.garciaripoll at googlemail.com
Sun Sep 6 06:46:18 UTC 2009
Matthew, can you provide me a minimal test? Right now I have a code
that interrupts a loop waiting to get a lock and it works 100% time.
Juanjo
(deftest mp-0001-with-lock
(progn
(defparameter *mp-0001-with-lock-a* t)
(defparameter *mp-0001-with-lock-b* (mp:make-lock))
(mp:with-lock (*mp-0001-with-lock-b*)
(let ((background-process
(mp:process-run-function
'mp-0001-with-lock
(coerce '(lambda ()
(handler-case
(progn
(setf *mp-0001-with-lock-a* 1)
(mp:with-lock (*mp-0001-with-lock-b*)
(setf *mp-0001-with-lock-a* 1)))
(error (c)
(princ c)(terpri)
(setf *mp-0001-with-lock-a* c)))
(setf *mp-0001-with-lock-a* 2))
'function))))
;; The background process should not be able to get
;; the lock, and will simply wait. Now we interrupt it
;; and the process should gracefully quit, without
;; signalling any serious condition
(and (mp:process-kill background-process)
(progn (sleep 1)
(not (mp:process-active-p background-process)))
(eq *mp-0001-with-lock-a* 1)))))
t)
On Sun, Sep 6, 2009 at 8:18 AM, Matthew Mondor<mm_lists at pulsar-zone.net> wrote:
> On Sat, 5 Sep 2009 23:44:56 +0200
> Juan Jose Garcia-Ripoll <juanjose.garciaripoll at googlemail.com> wrote:
>
>> [...]
>> I will commit this later on. It should solve your problems.
>
> I tested the new code but interestingly I get both success and
> failures. When it fails it's still with:
>
> Attempt to give up a lock [foo] that is not owned by [bar].
>
> I have not debugged the problem further as I just got home and it's now
> very late, so I'll try to obtain more info as necessary in the next few
> days.
>
> Thanks,
> --
> Matt
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Ecls-list mailing list
> Ecls-list at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ecls-list
>
--
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com
More information about the ecl-devel
mailing list