Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
ac1fa8f3
Commit
ac1fa8f3
authored
Sep 11, 2016
by
Kevin Modzelewski
Committed by
Kevin Modzelewski
Sep 12, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get test_socket working (better)
parent
b2b748ec
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
3 deletions
+24
-3
src/runtime/builtin_modules/thread.cpp
src/runtime/builtin_modules/thread.cpp
+24
-1
test/CPYTHON_TEST_NOTES.md
test/CPYTHON_TEST_NOTES.md
+0
-2
No files found.
src/runtime/builtin_modules/thread.cpp
View file @
ac1fa8f3
...
...
@@ -22,6 +22,7 @@
#include "core/threading.h"
#include "core/types.h"
#include "runtime/objmodel.h"
#include "capi/types.h"
#include "runtime/types.h"
using
namespace
pyston
::
threading
;
...
...
@@ -79,7 +80,8 @@ static void* thread_start(STOLEN(Box*) target, STOLEN(Box*) varargs, STOLEN(Box*
try
{
autoDecref
(
runtimeCall
(
target
,
ArgPassSpec
(
0
,
0
,
true
,
kwargs
!=
NULL
),
varargs
,
kwargs
,
NULL
,
NULL
,
NULL
));
}
catch
(
ExcInfo
e
)
{
e
.
printExcAndTraceback
();
if
(
!
e
.
matches
(
SystemExit
))
e
.
printExcAndTraceback
();
e
.
clear
();
}
...
...
@@ -212,6 +214,22 @@ Box* threadCount() {
return
boxInt
(
nb_threads
);
}
static
PyObject
*
thread_PyThread_exit_thread
(
PyObject
*
self
)
noexcept
{
PyErr_SetNone
(
PyExc_SystemExit
);
return
NULL
;
}
PyDoc_STRVAR
(
exit_doc
,
"exit()
\n
\
(exit_thread() is an obsolete synonym)
\n
\
\n
\
This is synonymous to ``raise SystemExit''. It will cause the current
\n
\
thread to exit silently unless the exception is caught."
);
static
PyMethodDef
thread_methods
[]
=
{
{
"exit_thread"
,
(
PyCFunction
)
thread_PyThread_exit_thread
,
METH_NOARGS
,
exit_doc
},
{
"exit"
,
(
PyCFunction
)
thread_PyThread_exit_thread
,
METH_NOARGS
,
exit_doc
},
};
void
setupThread
()
{
// Hacky: we want to use some of CPython's implementation of the thread module (the threading local stuff),
// and some of ours (thread handling). Start off by calling a cut-down version of initthread, and then
...
...
@@ -260,5 +278,10 @@ void setupThread() {
ThreadError
=
(
BoxedClass
*
)
PyErr_NewException
(
"thread.error"
,
NULL
,
NULL
);
thread_module
->
giveAttrBorrowed
(
"error"
,
ThreadError
);
auto
thread_str
=
getStaticString
(
"thread"
);
for
(
auto
&
md
:
thread_methods
)
{
thread_module
->
giveAttr
(
md
.
ml_name
,
new
BoxedCApiFunction
(
&
md
,
NULL
,
thread_str
));
}
}
}
test/CPYTHON_TEST_NOTES.md
View file @
ac1fa8f3
...
...
@@ -129,8 +129,6 @@ test_repr complex.__hash__; some unknown issues
test_resource fails on travis-ci: setrlimit RLIMIT_CPU not allowed to raise maximum limit
test_runpy [unknown]
test_scope eval of code object from existing function (not currently supported)
test_scriptpackages [unknown]
test_site [unknown]
test_startfile [unknown]
test_str memory leak?
test_structmembers [unknown]
...
...
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