This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Rob.Watson
Recipients Rob.Watson
Date 2010-09-19.23:04:10
SpamBayes Score 8.2153354e-05
Marked as misclassified No
Message-id <1284937455.45.0.396725320878.issue9900@psf.upfronthosting.co.za>
In-reply-to
Content
Is the below a bug or a misuse of the api ? This was compiled with visual studio 2008 and python26 64bit

void testfunction()
{
	for (int x = 1;x <= 100000;x++)
	{
		
		PyGILState_STATE gstate = PyGILState_Ensure();
		PyRun_SimpleString("2 + 1");
		PyGILState_Release(gstate);
	}	
}


int main()
{
	
	Py_Initialize();
	PyEval_InitThreads();
	PyEval_ReleaseLock();	
	
	boost::thread(boost::bind(testfunction));
	
        // if this Sleep(100) is commented out, I will get "Python Fatal Error : This thread state must be current when releasing"
	Sleep(100);
	testfunction();
	Sleep(1000000);
}
History
Date User Action Args
2010-09-19 23:04:15Rob.Watsonsetrecipients: + Rob.Watson
2010-09-19 23:04:15Rob.Watsonsetmessageid: <1284937455.45.0.396725320878.issue9900@psf.upfronthosting.co.za>
2010-09-19 23:04:11Rob.Watsonlinkissue9900 messages
2010-09-19 23:04:10Rob.Watsoncreate