bayonne-devel
[Top][All Lists]
Advanced

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

[Bayonne-devel] Lock/mutex mechanism problems


From: Richard Stade
Subject: [Bayonne-devel] Lock/mutex mechanism problems
Date: Wed, 20 Oct 2004 20:21:21 -0700 (PDT)

Hi,

I tried using lock.wait and lock.unlock
(bayonne-1.2.11, ccscript-2.5.6), but I encountered
errors with both.

1) when another task/script has locked the mutex,
lock.wait on current task should block but it does
not.

2) lock.unlock always returns "lock-invalid"
regardless.

I've isolated this to 2 small scripts for ease of
reproduction. testlock and testlock2 both contend for
the mutex. Anything that I'm doing incorrectly here?

Any suggestions would be appreciated.


testlock.scr
                                                      
                                                      
              ============
   slog "Start testlock"
   set %m_lock "1"
   start.trunk 2 testlock2
   slog "Locking mutex #1"
   lock.wait id=%m_lock
   slog "status=" %script.error
   slog "We are in between lock and unlock #1"
   sleep 5
   slog "Going to unlock #1"
   lock.unlock id=%m_lock
   slog "Lock #1 unlocked"
   exit
                                                      
                                                      
               
^error
   slog "Hit Error!!!!!!!!!!!!!!!!!!!!!!!!!!!="
%script.error
   exit


testlock2.scr
=============
   slog "Start testlock2"
   sleep 2
   set %m_lock "1"
   slog "Locking mutex #1"
   lock.wait id=%m_lock
   slog "status=" %script.error
   slog "We are in between lock and unlock #1"
   sleep 5
   slog "Going to unlock #1"
   lock.unlock id=%m_lock
   slog "Lock #1 unlocked"
   exit
                                                      
                         
^error
   slog "Hit Error!!!!!!!!!!!!!!!!!!!!!!!!!!!="
%script.error
   exit

Thanks.


                





reply via email to

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