Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
d3eaa745
Kaydet (Commit)
d3eaa745
authored
Nis 05, 2009
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#5615: make it possible to configure --without-threads again.
üst
1e566cec
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
6 deletions
+38
-6
connection.c
Modules/_sqlite/connection.c
+30
-6
module.c
Modules/_sqlite/module.c
+2
-0
object.c
Objects/object.c
+6
-0
No files found.
Modules/_sqlite/connection.c
Dosyayı görüntüle @
d3eaa745
...
...
@@ -168,8 +168,9 @@ int pysqlite_connection_init(pysqlite_Connection* self, PyObject* args, PyObject
self
->
detect_types
=
detect_types
;
self
->
timeout
=
timeout
;
(
void
)
sqlite3_busy_timeout
(
self
->
db
,
(
int
)(
timeout
*
1000
));
#ifdef WITH_THREAD
self
->
thread_ident
=
PyThread_get_thread_ident
();
#endif
self
->
check_same_thread
=
check_same_thread
;
self
->
function_pinboard
=
PyDict_New
();
...
...
@@ -585,9 +586,11 @@ void _pysqlite_func_callback(sqlite3_context* context, int argc, sqlite3_value**
PyObject
*
py_func
;
PyObject
*
py_retval
=
NULL
;
#ifdef WITH_THREAD
PyGILState_STATE
threadstate
;
threadstate
=
PyGILState_Ensure
();
#endif
py_func
=
(
PyObject
*
)
sqlite3_user_data
(
context
);
...
...
@@ -609,7 +612,9 @@ void _pysqlite_func_callback(sqlite3_context* context, int argc, sqlite3_value**
_sqlite3_result_error
(
context
,
"user-defined function raised exception"
,
-
1
);
}
#ifdef WITH_THREAD
PyGILState_Release
(
threadstate
);
#endif
}
static
void
_pysqlite_step_callback
(
sqlite3_context
*
context
,
int
argc
,
sqlite3_value
**
params
)
...
...
@@ -620,9 +625,11 @@ static void _pysqlite_step_callback(sqlite3_context *context, int argc, sqlite3_
PyObject
**
aggregate_instance
;
PyObject
*
stepmethod
=
NULL
;
#ifdef WITH_THREAD
PyGILState_STATE
threadstate
;
threadstate
=
PyGILState_Ensure
();
#endif
aggregate_class
=
(
PyObject
*
)
sqlite3_user_data
(
context
);
...
...
@@ -669,7 +676,9 @@ error:
Py_XDECREF
(
stepmethod
);
Py_XDECREF
(
function_result
);
#ifdef WITH_THREAD
PyGILState_Release
(
threadstate
);
#endif
}
void
_pysqlite_final_callback
(
sqlite3_context
*
context
)
...
...
@@ -678,9 +687,11 @@ void _pysqlite_final_callback(sqlite3_context* context)
PyObject
**
aggregate_instance
;
PyObject
*
aggregate_class
;
#ifdef WITH_THREAD
PyGILState_STATE
threadstate
;
threadstate
=
PyGILState_Ensure
();
#endif
aggregate_class
=
(
PyObject
*
)
sqlite3_user_data
(
context
);
...
...
@@ -708,7 +719,9 @@ error:
Py_XDECREF
(
*
aggregate_instance
);
Py_XDECREF
(
function_result
);
#ifdef WITH_THREAD
PyGILState_Release
(
threadstate
);
#endif
}
void
_pysqlite_drop_unused_statement_references
(
pysqlite_Connection
*
self
)
...
...
@@ -803,9 +816,11 @@ static int _authorizer_callback(void* user_arg, int action, const char* arg1, co
{
PyObject
*
ret
;
int
rc
;
#ifdef WITH_THREAD
PyGILState_STATE
gilstate
;
gilstate
=
PyGILState_Ensure
();
#endif
ret
=
PyObject_CallFunction
((
PyObject
*
)
user_arg
,
"issss"
,
action
,
arg1
,
arg2
,
dbname
,
access_attempt_source
);
if
(
!
ret
)
{
...
...
@@ -825,7 +840,9 @@ static int _authorizer_callback(void* user_arg, int action, const char* arg1, co
Py_DECREF
(
ret
);
}
#ifdef WITH_THREAD
PyGILState_Release
(
gilstate
);
#endif
return
rc
;
}
...
...
@@ -833,9 +850,11 @@ static int _progress_handler(void* user_arg)
{
int
rc
;
PyObject
*
ret
;
#ifdef WITH_THREAD
PyGILState_STATE
gilstate
;
gilstate
=
PyGILState_Ensure
();
#endif
ret
=
PyObject_CallFunction
((
PyObject
*
)
user_arg
,
""
);
if
(
!
ret
)
{
...
...
@@ -852,7 +871,9 @@ static int _progress_handler(void* user_arg)
Py_DECREF
(
ret
);
}
#ifdef WITH_THREAD
PyGILState_Release
(
gilstate
);
#endif
return
rc
;
}
...
...
@@ -907,6 +928,7 @@ PyObject* pysqlite_connection_set_progress_handler(pysqlite_Connection* self, Py
int
pysqlite_check_thread
(
pysqlite_Connection
*
self
)
{
#ifdef WITH_THREAD
if
(
self
->
check_same_thread
)
{
if
(
PyThread_get_thread_ident
()
!=
self
->
thread_ident
)
{
PyErr_Format
(
pysqlite_ProgrammingError
,
...
...
@@ -917,7 +939,7 @@ int pysqlite_check_thread(pysqlite_Connection* self)
}
}
#endif
return
1
;
}
...
...
@@ -1139,12 +1161,14 @@ pysqlite_collation_callback(
PyObject
*
callback
=
(
PyObject
*
)
context
;
PyObject
*
string1
=
0
;
PyObject
*
string2
=
0
;
#ifdef WITH_THREAD
PyGILState_STATE
gilstate
;
#endif
PyObject
*
retval
=
NULL
;
int
result
=
0
;
#ifdef WITH_THREAD
gilstate
=
PyGILState_Ensure
();
#endif
if
(
PyErr_Occurred
())
{
goto
finally
;
...
...
@@ -1173,9 +1197,9 @@ finally:
Py_XDECREF
(
string1
);
Py_XDECREF
(
string2
);
Py_XDECREF
(
retval
);
#ifdef WITH_THREAD
PyGILState_Release
(
gilstate
);
#endif
return
result
;
}
...
...
Modules/_sqlite/module.c
Dosyayı görüntüle @
d3eaa745
...
...
@@ -445,7 +445,9 @@ PyMODINIT_FUNC init_sqlite3(void)
* threads have already been initialized.
* (see pybsddb-users mailing list post on 2002-08-07)
*/
#ifdef WITH_THREAD
PyEval_InitThreads
();
#endif
error:
if
(
PyErr_Occurred
())
...
...
Objects/object.c
Dosyayı görüntüle @
d3eaa745
...
...
@@ -336,11 +336,17 @@ void _PyObject_Dump(PyObject* op)
if
(
op
==
NULL
)
fprintf
(
stderr
,
"NULL
\n
"
);
else
{
#ifdef WITH_THREAD
PyGILState_STATE
gil
;
#endif
fprintf
(
stderr
,
"object : "
);
#ifdef WITH_THREAD
gil
=
PyGILState_Ensure
();
#endif
(
void
)
PyObject_Print
(
op
,
stderr
,
0
);
#ifdef WITH_THREAD
PyGILState_Release
(
gil
);
#endif
/* XXX(twouters) cast refcount to long until %zd is
universally available */
fprintf
(
stderr
,
"
\n
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment