[Python-checkins] CVS: python/dist/src/Modules threadmodule.c,2.48,2.49

Guido van Rossum gvanrossum@users.sourceforge.net
Sat, 06 Apr 2002 22:32:24 -0800


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv26745

Modified Files:
	threadmodule.c 
Log Message:
Lock methods acquire() and locked() now return bools.


Index: threadmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/threadmodule.c,v
retrieving revision 2.48
retrieving revision 2.49
diff -C2 -d -r2.48 -r2.49
*** threadmodule.c	31 Mar 2002 15:27:00 -0000	2.48
--- threadmodule.c	7 Apr 2002 06:32:21 -0000	2.49
***************
*** 69,83 ****
  	}
  	else
! 		return PyInt_FromLong((long)i);
  }
  
  static char acquire_doc[] =
! "acquire([wait]) -> None or Boolean\n\
  (PyThread_acquire_lock() is an obsolete synonym)\n\
  \n\
  Lock the lock.  Without argument, this blocks if the lock is already\n\
  locked (even by the same thread), waiting for another thread to release\n\
! the lock, and return None when the lock is acquired.\n\
! With a Boolean argument, this will only block if the argument is true,\n\
  and the return value reflects whether the lock is acquired.\n\
  The blocking operation is not interruptible.";
--- 69,83 ----
  	}
  	else
! 		return PyBool_FromLong((long)i);
  }
  
  static char acquire_doc[] =
! "acquire([wait]) -> None or bool\n\
  (PyThread_acquire_lock() is an obsolete synonym)\n\
  \n\
  Lock the lock.  Without argument, this blocks if the lock is already\n\
  locked (even by the same thread), waiting for another thread to release\n\
! the lock, and return None once the lock is acquired.\n\
! With an argument, this will only block if the argument is true,\n\
  and the return value reflects whether the lock is acquired.\n\
  The blocking operation is not interruptible.";
***************
*** 111,121 ****
  	if (PyThread_acquire_lock(self->lock_lock, 0)) {
  		PyThread_release_lock(self->lock_lock);
! 		return PyInt_FromLong(0L);
  	}
! 	return PyInt_FromLong(1L);
  }
  
  static char locked_doc[] =
! "locked() -> Boolean\n\
  (locked_lock() is an obsolete synonym)\n\
  \n\
--- 111,121 ----
  	if (PyThread_acquire_lock(self->lock_lock, 0)) {
  		PyThread_release_lock(self->lock_lock);
! 		return PyBool_FromLong(0L);
  	}
! 	return PyBool_FromLong(1L);
  }
  
  static char locked_doc[] =
! "locked() -> bool\n\
  (locked_lock() is an obsolete synonym)\n\
  \n\