File tree Expand file tree Collapse file tree 1 file changed +0
-24
lines changed Expand file tree Collapse file tree 1 file changed +0
-24
lines changed Original file line number Diff line number Diff line change @@ -1121,17 +1121,9 @@ PyInterpreterState_SetNotRunningMain(PyInterpreterState *interp)
1121
1121
interp -> threads .main = NULL ;
1122
1122
}
1123
1123
1124
- static int interpreter_exists (PyInterpreterState * );
1125
-
1126
1124
int
1127
1125
PyInterpreterState_IsRunningMain (PyInterpreterState * interp )
1128
1126
{
1129
- HEAD_LOCK (interp -> runtime );
1130
- int exists = interpreter_exists (interp );
1131
- HEAD_UNLOCK (interp -> runtime );
1132
- if (!exists ) {
1133
- return 0 ;
1134
- }
1135
1127
if (interp -> threads .main == NULL ) {
1136
1128
return 0 ;
1137
1129
}
@@ -1248,22 +1240,6 @@ PyInterpreterState_GetDict(PyInterpreterState *interp)
1248
1240
// look up an interpreter state
1249
1241
//-----------------------------
1250
1242
1251
- /* This must be called with the "head" lock held. */
1252
- static int
1253
- interpreter_exists (PyInterpreterState * interp )
1254
- {
1255
- PyInterpreterState * actual = interp -> runtime -> interpreters .head ;
1256
- while (actual != NULL ) {
1257
- if (actual == interp ) {
1258
- return 1 ;
1259
- }
1260
- actual = actual -> next ;
1261
- }
1262
- // It's a dangling pointer.
1263
- return 0 ;
1264
- }
1265
-
1266
-
1267
1243
/* Return the interpreter associated with the current OS thread.
1268
1244
1269
1245
The GIL must be held.
You can’t perform that action at this time.
0 commit comments