mailr14537 - in /1.3: generic_fns/ gui/ gui/spin_viewer/


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on August 31, 2011 - 12:19:
Author: bugman
Date: Wed Aug 31 12:19:35 2011
New Revision: 14537

URL: http://svn.gna.org/viewcvs/relax?rev=14537&view=rev
Log:
All acquire() and release() calls for the spin_lock and pipe_lock objects now 
are named.

The name argument is now supplied to these methods.


Modified:
    1.3/generic_fns/mol_res_spin.py
    1.3/generic_fns/pipes.py
    1.3/gui/pipe_editor.py
    1.3/gui/results_viewer.py
    1.3/gui/spin_viewer/tree.py

Modified: 1.3/generic_fns/mol_res_spin.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/mol_res_spin.py?rev=14537&r1=14536&r2=14537&view=diff
==============================================================================
--- 1.3/generic_fns/mol_res_spin.py (original)
+++ 1.3/generic_fns/mol_res_spin.py Wed Aug 31 12:19:35 2011
@@ -603,7 +603,7 @@
     """
 
     # Acquire the spin lock (data modifying function), and make sure it is 
finally released.
-    status.spin_lock.acquire()
+    status.spin_lock.acquire(sys._getframe().f_code.co_name)
     try:
         # The current data pipe.
         if pipe_from == None:
@@ -656,7 +656,7 @@
 
     # Release the lock.
     finally:
-        status.spin_lock.release()
+        status.spin_lock.release(sys._getframe().f_code.co_name)
 
 
 def copy_residue(pipe_from=None, res_from=None, pipe_to=None, res_to=None):
@@ -678,7 +678,7 @@
     """
 
     # Acquire the spin lock (data modifying function), and make sure it is 
finally released.
-    status.spin_lock.acquire()
+    status.spin_lock.acquire(sys._getframe().f_code.co_name)
     try:
         # The current data pipe.
         if pipe_from == None:
@@ -734,7 +734,7 @@
 
     # Release the lock.
     finally:
-        status.spin_lock.release()
+        status.spin_lock.release(sys._getframe().f_code.co_name)
 
 
 def copy_spin(pipe_from=None, spin_from=None, pipe_to=None, spin_to=None):
@@ -756,7 +756,7 @@
     """
 
     # Acquire the spin lock (data modifying function), and make sure it is 
finally released.
-    status.spin_lock.acquire()
+    status.spin_lock.acquire(sys._getframe().f_code.co_name)
     try:
         # The current data pipe.
         if pipe_from == None:
@@ -813,7 +813,7 @@
 
     # Release the lock.
     finally:
-        status.spin_lock.release()
+        status.spin_lock.release(sys._getframe().f_code.co_name)
 
 
 def count_molecules(selection=None, pipe=None):
@@ -937,7 +937,7 @@
     pipes.test()
 
     # Acquire the spin lock (data modifying function), and make sure it is 
finally released.
-    status.spin_lock.acquire()
+    status.spin_lock.acquire(sys._getframe().f_code.co_name)
     try:
         # Test the molecule type.
         if mol_type and mol_type not in ALLOWED_MOL_TYPES:
@@ -956,7 +956,7 @@
 
     # Release the lock.
     finally:
-        status.spin_lock.release()
+        status.spin_lock.release(sys._getframe().f_code.co_name)
 
     # Return the molecule.
     return mol
@@ -983,7 +983,7 @@
         create_molecule(mol_name=mol_name)
 
     # Acquire the spin lock (data modifying function), and make sure it is 
finally released.
-    status.spin_lock.acquire()
+    status.spin_lock.acquire(sys._getframe().f_code.co_name)
     try:
         # Get the molecule container to add the residue to.
         mol_cont = return_molecule(generate_spin_id(mol_name=mol_name))
@@ -998,7 +998,7 @@
 
     # Release the lock.
     finally:
-        status.spin_lock.release()
+        status.spin_lock.release(sys._getframe().f_code.co_name)
 
     # Return the residue.
     return res
@@ -1019,7 +1019,7 @@
     pipes.test()
 
     # Acquire the spin lock (data modifying function), and make sure it is 
finally released.
-    status.spin_lock.acquire()
+    status.spin_lock.acquire(sys._getframe().f_code.co_name)
     try:
         # Split up the selection string.
         mol_token, res_token, spin_token = tokenise(res_id)
@@ -1099,7 +1099,7 @@
 
     # Release the lock.
     finally:
-        status.spin_lock.release()
+        status.spin_lock.release(sys._getframe().f_code.co_name)
 
 
 def create_spin(spin_num=None, spin_name=None, res_num=None, res_name=None, 
mol_name=None):
@@ -1129,7 +1129,7 @@
         create_residue(mol_name=mol_name, res_num=res_num, res_name=res_name)
 
     # Acquire the spin lock (data modifying function), and make sure it is 
finally released.
-    status.spin_lock.acquire()
+    status.spin_lock.acquire(sys._getframe().f_code.co_name)
     try:
         # Get the residue container to add the spin to.
         res_cont = return_residue(generate_spin_id(mol_name=mol_name, 
res_num=res_num, res_name=res_name))
@@ -1149,7 +1149,7 @@
 
     # Release the lock.
     finally:
-        status.spin_lock.release()
+        status.spin_lock.release(sys._getframe().f_code.co_name)
 
     # Return the spin.
     return spin_cont
@@ -1193,7 +1193,7 @@
     """
 
     # Acquire the spin lock (data modifying function), and make sure it is 
finally released.
-    status.spin_lock.acquire()
+    status.spin_lock.acquire(sys._getframe().f_code.co_name)
     try:
         # Split up the selection string.
         mol_token, res_token, spin_token = tokenise(mol_id)
@@ -1231,7 +1231,7 @@
 
     # Release the lock.
     finally:
-        status.spin_lock.release()
+        status.spin_lock.release(sys._getframe().f_code.co_name)
 
 
 def delete_residue(res_id=None):
@@ -1242,7 +1242,7 @@
     """
 
     # Acquire the spin lock (data modifying function), and make sure it is 
finally released.
-    status.spin_lock.acquire()
+    status.spin_lock.acquire(sys._getframe().f_code.co_name)
     try:
         # Split up the selection string.
         mol_token, res_token, spin_token = tokenise(res_id)
@@ -1278,7 +1278,7 @@
 
     # Release the lock.
     finally:
-        status.spin_lock.release()
+        status.spin_lock.release(sys._getframe().f_code.co_name)
 
 
 def delete_spin(spin_id=None):
@@ -1289,7 +1289,7 @@
     """
 
     # Acquire the spin lock (data modifying function), and make sure it is 
finally released.
-    status.spin_lock.acquire()
+    status.spin_lock.acquire(sys._getframe().f_code.co_name)
     try:
 
         # Split up the selection string.
@@ -1322,7 +1322,7 @@
 
     # Release the lock.
     finally:
-        status.spin_lock.release()
+        status.spin_lock.release(sys._getframe().f_code.co_name)
 
 
 def display_molecule(mol_id=None):
@@ -1798,7 +1798,7 @@
     """
 
     # Acquire the spin lock (data modifying function), and make sure it is 
finally released.
-    status.spin_lock.acquire()
+    status.spin_lock.acquire(sys._getframe().f_code.co_name)
     try:
 
         # Get the single molecule data container.
@@ -1820,7 +1820,7 @@
 
     # Release the lock.
     finally:
-        status.spin_lock.release()
+        status.spin_lock.release(sys._getframe().f_code.co_name)
 
 
 def name_residue(res_id, name=None, force=False):
@@ -1835,7 +1835,7 @@
     """
 
     # Acquire the spin lock (data modifying function), and make sure it is 
finally released.
-    status.spin_lock.acquire()
+    status.spin_lock.acquire(sys._getframe().f_code.co_name)
     try:
         # Disallow spin selections.
         select_obj = Selection(res_id)
@@ -1851,7 +1851,7 @@
 
     # Release the lock.
     finally:
-        status.spin_lock.release()
+        status.spin_lock.release(sys._getframe().f_code.co_name)
 
 
 def name_spin(spin_id=None, name=None, force=False):
@@ -1866,7 +1866,7 @@
     """
 
     # Acquire the spin lock (data modifying function), and make sure it is 
finally released.
-    status.spin_lock.acquire()
+    status.spin_lock.acquire(sys._getframe().f_code.co_name)
     try:
         # Rename the matching spins.
         for spin, id in spin_loop(spin_id, return_id=True):
@@ -1877,7 +1877,7 @@
 
     # Release the lock.
     finally:
-        status.spin_lock.release()
+        status.spin_lock.release(sys._getframe().f_code.co_name)
 
 
 def number_residue(res_id, number=None, force=False):
@@ -1892,7 +1892,7 @@
     """
 
     # Acquire the spin lock (data modifying function), and make sure it is 
finally released.
-    status.spin_lock.acquire()
+    status.spin_lock.acquire(sys._getframe().f_code.co_name)
     try:
         # Catch multiple numberings!
         i = 0
@@ -1917,7 +1917,7 @@
 
     # Release the lock.
     finally:
-        status.spin_lock.release()
+        status.spin_lock.release(sys._getframe().f_code.co_name)
 
 
 def number_spin(spin_id=None, number=None, force=False):
@@ -1932,7 +1932,7 @@
     """
 
     # Acquire the spin lock (data modifying function), and make sure it is 
finally released.
-    status.spin_lock.acquire()
+    status.spin_lock.acquire(sys._getframe().f_code.co_name)
     try:
         # Catch multiple renumberings!
         i = 0
@@ -1952,7 +1952,7 @@
 
     # Release the lock.
     finally:
-        status.spin_lock.release()
+        status.spin_lock.release(sys._getframe().f_code.co_name)
 
 
 def one_letter_code(res_names):

Modified: 1.3/generic_fns/pipes.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/pipes.py?rev=14537&r1=14536&r2=14537&view=diff
==============================================================================
--- 1.3/generic_fns/pipes.py (original)
+++ 1.3/generic_fns/pipes.py Wed Aug 31 12:19:35 2011
@@ -65,7 +65,7 @@
         raise RelaxPipeError(pipe_to)
 
     # Acquire the pipe lock (data modifying function), and make sure it is 
finally released.
-    status.pipe_lock.acquire()
+    status.pipe_lock.acquire(sys._getframe().f_code.co_name)
     try:
         # The current data pipe.
         if pipe_from == None:
@@ -76,7 +76,7 @@
 
     # Release the lock.
     finally:
-        status.pipe_lock.release()
+        status.pipe_lock.release(sys._getframe().f_code.co_name)
 
     # Notify observers that a pipe change has occurred.
     status.observers.pipe_alteration.notify()
@@ -118,14 +118,14 @@
         raise RelaxError("The frame order analysis is not available.  Please 
install the scipy Python package.")
 
     # Acquire the pipe lock (data modifying function), and make sure it is 
finally released.
-    status.pipe_lock.acquire()
+    status.pipe_lock.acquire(sys._getframe().f_code.co_name)
     try:
         # Add the data pipe.
         ds.add(pipe_name=pipe_name, pipe_type=pipe_type, switch=switch)
 
     # Release the lock.
     finally:
-        status.pipe_lock.release()
+        status.pipe_lock.release(sys._getframe().f_code.co_name)
 
 
 def cdp_name():
@@ -146,7 +146,7 @@
     """
 
     # Acquire the pipe lock (data modifying function), and make sure it is 
finally released.
-    status.pipe_lock.acquire()
+    status.pipe_lock.acquire(sys._getframe().f_code.co_name)
     try:
         # Pipe name is supplied.
         if pipe_name != None:
@@ -172,7 +172,7 @@
 
     # Release the lock.
     finally:
-        status.pipe_lock.release()
+        status.pipe_lock.release(sys._getframe().f_code.co_name)
 
     # Notify observers that the switch has occurred.
     status.observers.pipe_alteration.notify()
@@ -182,7 +182,7 @@
     """Print the details of all the data pipes."""
 
     # Acquire the pipe lock, and make sure it is finally released.
-    status.pipe_lock.acquire()
+    status.pipe_lock.acquire(sys._getframe().f_code.co_name)
     try:
         # Heading.
         print(("%-20s%-20s%-20s" % ("Data pipe name", "Data pipe type", 
"Current")))
@@ -199,7 +199,7 @@
 
     # Release the lock.
     finally:
-        status.pipe_lock.release()
+        status.pipe_lock.release(sys._getframe().f_code.co_name)
 
 
 def get_pipe(name=None):
@@ -267,7 +267,7 @@
     """
 
     # Acquire the pipe lock, and make sure it is finally released.
-    status.pipe_lock.acquire()
+    status.pipe_lock.acquire(sys._getframe().f_code.co_name)
     try:
         # Loop over the keys.
         for key in list(ds.keys()):
@@ -281,7 +281,7 @@
 
     # Release the lock.
     finally:
-        status.pipe_lock.release()
+        status.pipe_lock.release(sys._getframe().f_code.co_name)
 
 
 def pipe_names():
@@ -302,7 +302,7 @@
     """
 
     # Acquire the pipe lock (data modifying function), and make sure it is 
finally released.
-    status.pipe_lock.acquire()
+    status.pipe_lock.acquire(sys._getframe().f_code.co_name)
     try:
         # Test if the data pipe exists.
         test(pipe_name)
@@ -313,7 +313,7 @@
 
     # Release the lock.
     finally:
-        status.pipe_lock.release()
+        status.pipe_lock.release(sys._getframe().f_code.co_name)
 
     # Notify observers that the switch has occurred.
     status.observers.pipe_alteration.notify()

Modified: 1.3/gui/pipe_editor.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/gui/pipe_editor.py?rev=14537&r1=14536&r2=14537&view=diff
==============================================================================
--- 1.3/gui/pipe_editor.py (original)
+++ 1.3/gui/pipe_editor.py Wed Aug 31 12:19:35 2011
@@ -423,7 +423,7 @@
         self.grid.Freeze()
 
         # Acquire the pipe lock.
-        status.pipe_lock.acquire()
+        status.pipe_lock.acquire('pipe editor window')
 
         # Delete the rows, leaving a single row.
         self.grid.DeleteRows(numRows=self.grid.GetNumberRows()-1)
@@ -466,7 +466,7 @@
                 self.grid.SetReadOnly(i, j)
 
         # Release the lock.
-        status.pipe_lock.release()
+        status.pipe_lock.release('pipe editor window')
 
         # Unfreeze.
         self.grid.Thaw()

Modified: 1.3/gui/results_viewer.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/gui/results_viewer.py?rev=14537&r1=14536&r2=14537&view=diff
==============================================================================
--- 1.3/gui/results_viewer.py (original)
+++ 1.3/gui/results_viewer.py Wed Aug 31 12:19:35 2011
@@ -279,7 +279,7 @@
         """Update the list of result files (thread safe)."""
 
         # Acquire the pipe lock.
-        status.pipe_lock.acquire()
+        status.pipe_lock.acquire('results viewer window')
         try:
             # Update the data pipe selector.
             self.update_pipes()
@@ -299,7 +299,7 @@
 
         # Release the locks.
         finally:
-            status.pipe_lock.release()
+            status.pipe_lock.release('results viewer window')
 
 
     def resize(self, event):

Modified: 1.3/gui/spin_viewer/tree.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/gui/spin_viewer/tree.py?rev=14537&r1=14536&r2=14537&view=diff
==============================================================================
--- 1.3/gui/spin_viewer/tree.py (original)
+++ 1.3/gui/spin_viewer/tree.py Wed Aug 31 12:19:35 2011
@@ -648,8 +648,8 @@
         """Update the tree view using the given data pipe."""
 
         # Acquire the pipe and spin locks.
-        status.pipe_lock.acquire()
-        status.spin_lock.acquire()
+        status.pipe_lock.acquire('spin viewer window')
+        status.spin_lock.acquire('spin viewer window')
         try:
             # The data pipe.
             if not pipe_name:
@@ -671,8 +671,8 @@
 
         # Release the locks.
         finally:
-            status.pipe_lock.release()
-            status.spin_lock.release()
+            status.pipe_lock.release('spin viewer window')
+            status.spin_lock.release('spin viewer window')
 
 
     def update_mol(self, mol, mol_id):




Related Messages


Powered by MHonArc, Updated Wed Aug 31 12:40:02 2011