[Python-checkins] CVS: python/dist/src/Lib/lib-old lockfile.py,1.1,1.1.12.1

Tim Peters tim_one@users.sourceforge.net
Sat, 07 Jul 2001 15:56:00 -0700


Update of /cvsroot/python/python/dist/src/Lib/lib-old
In directory usw-pr-cvs1:/tmp/cvs-serv24450/mergedescr/dist/src/Lib/lib-old

Modified Files:
      Tag: descr-branch
	lockfile.py 
Log Message:
Merge of trunk tag date2001-07-06 into descr-branch.


Index: lockfile.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/lib-old/lockfile.py,v
retrieving revision 1.1
retrieving revision 1.1.12.1
diff -C2 -r1.1 -r1.1.12.1
*** lockfile.py	1994/05/03 14:46:18	1.1
--- lockfile.py	2001/07/07 22:55:28	1.1.12.1
***************
*** 1,15 ****
! import struct, fcntl, FCNTL
  
  def writelock(f):
! 	_lock(f, FCNTL.F_WRLCK)
  
  def readlock(f):
! 	_lock(f, FCNTL.F_RDLCK)
  
  def unlock(f):
! 	_lock(f, FCNTL.F_UNLCK)
  
  def _lock(f, op):
! 	dummy = fcntl.fcntl(f.fileno(), FCNTL.F_SETLKW,
  			    struct.pack('2h8l', op,
  					0, 0, 0, 0, 0, 0, 0, 0, 0))
--- 1,15 ----
! import struct, fcntl
  
  def writelock(f):
! 	_lock(f, fcntl.F_WRLCK)
  
  def readlock(f):
! 	_lock(f, fcntl.F_RDLCK)
  
  def unlock(f):
! 	_lock(f, fcntl.F_UNLCK)
  
  def _lock(f, op):
! 	dummy = fcntl.fcntl(f.fileno(), fcntl.F_SETLKW,
  			    struct.pack('2h8l', op,
  					0, 0, 0, 0, 0, 0, 0, 0, 0))