Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
e259a3f2
Commit
e259a3f2
authored
Jan 31, 2013
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runtime: Block signals when creating a new thread.
From-SVN: r195619
parent
3b35cd04
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletions
+13
-1
libgo/runtime/proc.c
+13
-1
No files found.
libgo/runtime/proc.c
View file @
e259a3f2
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
// license that can be found in the LICENSE file.
// license that can be found in the LICENSE file.
#include <limits.h>
#include <limits.h>
#include <signal.h>
#include <stdlib.h>
#include <stdlib.h>
#include <pthread.h>
#include <pthread.h>
#include <unistd.h>
#include <unistd.h>
...
@@ -1217,6 +1218,9 @@ runtime_newm(void)
...
@@ -1217,6 +1218,9 @@ runtime_newm(void)
pthread_attr_t
attr
;
pthread_attr_t
attr
;
pthread_t
tid
;
pthread_t
tid
;
size_t
stacksize
;
size_t
stacksize
;
sigset_t
clear
;
sigset_t
old
;
int
ret
;
#if 0
#if 0
static const Type *mtype; // The Go type M
static const Type *mtype; // The Go type M
...
@@ -1249,7 +1253,15 @@ runtime_newm(void)
...
@@ -1249,7 +1253,15 @@ runtime_newm(void)
if
(
pthread_attr_setstacksize
(
&
attr
,
stacksize
)
!=
0
)
if
(
pthread_attr_setstacksize
(
&
attr
,
stacksize
)
!=
0
)
runtime_throw
(
"pthread_attr_setstacksize"
);
runtime_throw
(
"pthread_attr_setstacksize"
);
if
(
pthread_create
(
&
tid
,
&
attr
,
runtime_mstart
,
mp
)
!=
0
)
// Block signals during pthread_create so that the new thread
// starts with signals disabled. It will enable them in minit.
sigfillset
(
&
clear
);
sigemptyset
(
&
old
);
sigprocmask
(
SIG_BLOCK
,
&
clear
,
&
old
);
ret
=
pthread_create
(
&
tid
,
&
attr
,
runtime_mstart
,
mp
);
sigprocmask
(
SIG_SETMASK
,
&
old
,
nil
);
if
(
ret
!=
0
)
runtime_throw
(
"pthread_create"
);
runtime_throw
(
"pthread_create"
);
return
mp
;
return
mp
;
...
...
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