Staging
v0.5.1
https://github.com/python/cpython
Revision c21d0cb6cf1c32158a37772545fb71e730ab1323 authored by Gregory P. Smith on 01 March 2010, 04:40:36 UTC, committed by Gregory P. Smith on 01 March 2010, 04:40:36 UTC
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r78527 | gregory.p.smith | 2010-02-28 17:22:39 -0800 (Sun, 28 Feb 2010) | 4 lines

  Issue #7242: On Solaris 9 and earlier calling os.fork() from within a
  thread could raise an incorrect RuntimeError about not holding the import
  lock.  The import lock is now reinitialized after fork.
........
  r78531 | gregory.p.smith | 2010-02-28 18:31:33 -0800 (Sun, 28 Feb 2010) | 2 lines

  Fix for r78527.  It left out updating forkpty.
........
1 parent 56f1682
Raw File
Tip revision: c21d0cb6cf1c32158a37772545fb71e730ab1323 authored by Gregory P. Smith on 01 March 2010, 04:40:36 UTC
Merged revisions 78527,78531 via svnmerge from
Tip revision: c21d0cb
sleep.c
#include "oslib/osmodule.h"
#include <stdio.h>
#include "kernel.h"
#include <limits.h>
#include <errno.h>
#include "oslib/taskwindow.h"
#include "Python.h"


int riscos_sleep(double delay)
{
	os_t starttime, endtime, time; /* monotonic times (centiseconds) */
	int *pollword, ret;
	osbool claimed;

        /* calculate end time */
	starttime = os_read_monotonic_time();
	if (starttime + 100.0*delay >INT_MAX)
		endtime = INT_MAX;
	else
		endtime = (os_t)(starttime + 100.0*delay);

	/* allocate (in RMA) and set pollword for xupcall_sleep */
	pollword = osmodule_alloc(4);
	*pollword = 1;

	time = starttime;
	ret = 0;
	while ( time<endtime && time>=starttime ) {
		xupcall_sleep (pollword, &claimed);
		if (PyErr_CheckSignals()) {
			ret = 1;
			break;
		}
		time = os_read_monotonic_time();
	}

	/* deallocate pollword */
	osmodule_free(pollword);
	return ret;
}
back to top