Staging
v0.8.1
Revision ba32b72be5029437aac83f27507588fe4dde8dbf authored by Martin v. Löwis on 05 July 2008, 15:55:00 UTC, committed by Martin v. Löwis on 05 July 2008, 15:55:00 UTC
svn+ssh://pythondev@svn.python.org/python/trunk

................
  r64736 | martin.v.loewis | 2008-07-05 17:45:45 +0200 (Sa, 05 Jul 2008) | 20 lines

  Merged revisions 64285-64735 via svnmerge from
  svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3

  ........
    r64493 | benjamin.peterson | 2008-06-24 04:14:14 +0200 (Di, 24 Jun 2008) | 1 line

    add a fix_import mapping for cPickle -> pickle
  ........
    r64651 | brett.cannon | 2008-07-02 04:00:11 +0200 (Mi, 02 Jul 2008) | 3 lines

    Update fix_imports for urllib. Had to change the fixer itself to handle modules
    that are split across several renames in 3.0.
  ........
    r64669 | brett.cannon | 2008-07-02 21:43:48 +0200 (Mi, 02 Jul 2008) | 4 lines

    Backing out last change until fix_imports is working again. Also re-enable the
    testing for fix_imports; if it is deemed that it takes too long to run then a
    random sample should be taken and used to test it.
  ........
................
  r64737 | martin.v.loewis | 2008-07-05 17:48:20 +0200 (Sa, 05 Jul 2008) | 2 lines

  Disable lib2to3 by default, unless run explicitly.
................
1 parent 0d748c2
Raw File
thread_foobar.h

/*
 * Initialization.
 */
static void
PyThread__init_thread(void)
{
}

/*
 * Thread support.
 */
long
PyThread_start_new_thread(void (*func)(void *), void *arg)
{
	int success = 0;	/* init not needed when SOLARIS_THREADS and */
				/* C_THREADS implemented properly */

	dprintf(("PyThread_start_new_thread called\n"));
	if (!initialized)
		PyThread_init_thread();
	return success < 0 ? -1 : 0;
}

long
PyThread_get_thread_ident(void)
{
	if (!initialized)
		PyThread_init_thread();
}

static
void do_PyThread_exit_thread(int no_cleanup)
{
	dprintf(("PyThread_exit_thread called\n"));
	if (!initialized)
		if (no_cleanup)
			_exit(0);
		else
			exit(0);
}

void
PyThread_exit_thread(void)
{
	do_PyThread_exit_thread(0);
}

void
PyThread__exit_thread(void)
{
	do_PyThread_exit_thread(1);
}

#ifndef NO_EXIT_PROG
static
void do_PyThread_exit_prog(int status, int no_cleanup)
{
	dprintf(("PyThread_exit_prog(%d) called\n", status));
	if (!initialized)
		if (no_cleanup)
			_exit(status);
		else
			exit(status);
}

void
PyThread_exit_prog(int status)
{
	do_PyThread_exit_prog(status, 0);
}

void
PyThread__exit_prog(int status)
{
	do_PyThread_exit_prog(status, 1);
}
#endif /* NO_EXIT_PROG */

/*
 * Lock support.
 */
PyThread_type_lock
PyThread_allocate_lock(void)
{

	dprintf(("PyThread_allocate_lock called\n"));
	if (!initialized)
		PyThread_init_thread();

	dprintf(("PyThread_allocate_lock() -> %p\n", lock));
	return (PyThread_type_lock) lock;
}

void
PyThread_free_lock(PyThread_type_lock lock)
{
	dprintf(("PyThread_free_lock(%p) called\n", lock));
}

int
PyThread_acquire_lock(PyThread_type_lock lock, int waitflag)
{
	int success;

	dprintf(("PyThread_acquire_lock(%p, %d) called\n", lock, waitflag));
	dprintf(("PyThread_acquire_lock(%p, %d) -> %d\n", lock, waitflag, success));
	return success;
}

void
PyThread_release_lock(PyThread_type_lock lock)
{
	dprintf(("PyThread_release_lock(%p) called\n", lock));
}
back to top