| [ Web Proxy ] |
| Viewing: https://raw.githubusercontent.com/sdpython/pythonnet/master/src/embed_tests/TestGILState.cs | [Back] [Original] |
namespace Python.EmbeddingTest
{
using NUnit.Framework;
using Python.Runtime;
public class TestGILState
{
///
/// Ensure, that calling multiple times is safe
///
[Test]
public void CanDisposeMultipleTimes()
{
using (var gilState = Py.GIL())
{
for(int i = 0; i < 50; i++)
gilState.Dispose();
}
}
[OneTimeSetUp]
public void SetUp()
{
PythonEngine.Initialize();
}
[OneTimeTearDown]
public void Dispose()
{
PythonEngine.Shutdown();
}
}
}
| Web Proxy Viewer | New URL | Original Page |