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
01ae20e9
Commit
01ae20e9
authored
Aug 06, 2014
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup
parent
cd11e1d5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
14 deletions
+6
-14
src/core/threading.cpp
src/core/threading.cpp
+1
-8
src/core/threading.h
src/core/threading.h
+5
-6
No files found.
src/core/threading.cpp
View file @
01ae20e9
...
...
@@ -27,8 +27,6 @@
#include "core/thread_utils.h"
#include "core/util.h"
extern
"C"
int
start_thread
(
void
*
arg
);
namespace
pyston
{
namespace
threading
{
...
...
@@ -64,6 +62,7 @@ struct ThreadStateInternal {
};
static
std
::
unordered_map
<
pid_t
,
ThreadStateInternal
>
saved_thread_states
;
// TODO could optimize these by keeping a __thread local reference to current_threads[gettid()]
void
*
getStackBottom
()
{
return
current_threads
[
gettid
()].
stack_bottom
;
}
...
...
@@ -282,15 +281,9 @@ static void* find_stack() {
return
NULL
;
/* not found =^P */
}
intptr_t
call_frame_base
;
void
registerMainThread
()
{
LOCK_REGION
(
&
threading_lock
);
// Would be nice if we could set this to the pthread start_thread,
// since _thread_start doesn't always show up in the traceback.
// call_frame_base = (intptr_t)::start_thread;
call_frame_base
=
(
intptr_t
)
_thread_start
;
current_threads
[
gettid
()]
=
ThreadInfo
{
.
stack_bottom
=
find_stack
(),
.
pthread_id
=
pthread_self
(),
};
...
...
src/core/threading.h
View file @
01ae20e9
...
...
@@ -28,12 +28,9 @@ class Box;
namespace
threading
{
// returns a thread id (currently, the pthread_t id)
intptr_t
start_thread
(
void
*
(
*
start_func
)(
Box
*
,
Box
*
,
Box
*
),
Box
*
arg1
,
Box
*
arg2
,
Box
*
arg3
);
// The base of the call frame stack for a thread;
// useful for knowing when to stop unwinding.
extern
intptr_t
call_frame_base
;
void
registerMainThread
();
struct
ThreadState
{
...
...
@@ -53,10 +50,12 @@ struct ThreadState {
// as a corollary, this thread is very much not thread safe.
std
::
vector
<
ThreadState
>
getAllThreadStates
();
// Get the stack "bottom" (
first pushed data; for stacks that grow down, will
// be the highest address).
// Get the stack "bottom" (
ie first pushed data. For stacks that grow down, this
//
will
be the highest address).
void
*
getStackBottom
();
#ifndef THREADING_USE_GIL
#define THREADING_USE_GIL 1
#define THREADING_USE_GRWL 0
...
...
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