FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pythonnet/src/embed_tests/TestGILState.cs at python3.9 · sdpython/pythonnet · GitHub
This repository was archived by the owner on Jul 22, 2023. It is now read-only.
sdpython
pythonnet
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
pythonnet
/
src
/
embed_tests
/
TestGILState.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
33 lines (30 loc) · 728 Bytes
Breadcrumbs
pythonnet
/
src
/
embed_tests
/
TestGILState.cs
Copy path
File metadata and controls
33 lines (30 loc) · 728 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
namespace
Python
.
EmbeddingTest
{
using
NUnit
.
Framework
;
using
Python
.
Runtime
;
public
class
TestGILState
{
/// <summary>
/// Ensure, that calling <see cref="Py.GILState.Dispose"/> multiple times is safe
/// </summary>
[
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
(
)
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL