Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
a026d0fc
Commit
a026d0fc
authored
Jun 28, 2011
by
Albert Strasheim
Committed by
Russ Cox
Jun 28, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runtime/cgo: check for errors from pthread_create
R=rsc, iant, dvyukov CC=golang-dev
https://golang.org/cl/4643057
parent
660b2298
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
47 additions
and
8 deletions
+47
-8
darwin.c
src/libmach/darwin.c
+11
-2
darwin_386.c
src/pkg/runtime/cgo/darwin_386.c
+6
-1
darwin_amd64.c
src/pkg/runtime/cgo/darwin_amd64.c
+6
-1
freebsd_386.c
src/pkg/runtime/cgo/freebsd_386.c
+6
-1
freebsd_amd64.c
src/pkg/runtime/cgo/freebsd_amd64.c
+6
-1
linux_386.c
src/pkg/runtime/cgo/linux_386.c
+6
-1
linux_amd64.c
src/pkg/runtime/cgo/linux_amd64.c
+6
-1
No files found.
src/libmach/darwin.c
View file @
a026d0fc
...
...
@@ -222,12 +222,21 @@ addpid(int pid, int force)
// The excthread reads that port and signals
// us if we are waiting on that thread.
pthread_t
p
;
int
err
;
excport
=
mach_reply_port
();
pthread_mutex_init
(
&
mu
,
nil
);
pthread_cond_init
(
&
cond
,
nil
);
pthread_create
(
&
p
,
nil
,
excthread
,
nil
);
pthread_create
(
&
p
,
nil
,
waitthread
,
(
void
*
)(
uintptr
)
pid
);
err
=
pthread_create
(
&
p
,
nil
,
excthread
,
nil
);
if
(
err
!=
0
)
{
fprint
(
2
,
"pthread_create failed: %s
\n
"
,
strerror
(
err
));
abort
();
}
err
=
pthread_create
(
&
p
,
nil
,
waitthread
,
(
void
*
)(
uintptr
)
pid
);
if
(
err
!=
0
)
{
fprint
(
2
,
"pthread_create failed: %s
\n
"
,
strerror
(
err
));
abort
();
}
first
=
0
;
}
...
...
src/pkg/runtime/cgo/darwin_386.c
View file @
a026d0fc
...
...
@@ -113,11 +113,16 @@ libcgo_sys_thread_start(ThreadStart *ts)
pthread_attr_t
attr
;
pthread_t
p
;
size_t
size
;
int
err
;
pthread_attr_init
(
&
attr
);
pthread_attr_getstacksize
(
&
attr
,
&
size
);
ts
->
g
->
stackguard
=
size
;
pthread_create
(
&
p
,
&
attr
,
threadentry
,
ts
);
err
=
pthread_create
(
&
p
,
&
attr
,
threadentry
,
ts
);
if
(
err
!=
0
)
{
fprintf
(
stderr
,
"runtime/cgo: pthread_create failed: %s
\n
"
,
strerror
(
error
));
abort
();
}
}
static
void
*
...
...
src/pkg/runtime/cgo/darwin_amd64.c
View file @
a026d0fc
...
...
@@ -83,11 +83,16 @@ libcgo_sys_thread_start(ThreadStart *ts)
pthread_attr_t
attr
;
pthread_t
p
;
size_t
size
;
int
err
;
pthread_attr_init
(
&
attr
);
pthread_attr_getstacksize
(
&
attr
,
&
size
);
ts
->
g
->
stackguard
=
size
;
pthread_create
(
&
p
,
&
attr
,
threadentry
,
ts
);
err
=
pthread_create
(
&
p
,
&
attr
,
threadentry
,
ts
);
if
(
err
!=
0
)
{
fprintf
(
stderr
,
"runtime/cgo: pthread_create failed: %s
\n
"
,
strerror
(
err
));
abort
();
}
}
static
void
*
...
...
src/pkg/runtime/cgo/freebsd_386.c
View file @
a026d0fc
...
...
@@ -20,11 +20,16 @@ libcgo_sys_thread_start(ThreadStart *ts)
pthread_attr_t
attr
;
pthread_t
p
;
size_t
size
;
int
err
;
pthread_attr_init
(
&
attr
);
pthread_attr_getstacksize
(
&
attr
,
&
size
);
ts
->
g
->
stackguard
=
size
;
pthread_create
(
&
p
,
&
attr
,
threadentry
,
ts
);
err
=
pthread_create
(
&
p
,
&
attr
,
threadentry
,
ts
);
if
(
err
!=
0
)
{
fprintf
(
stderr
,
"runtime/cgo: pthread_create failed: %s
\n
"
,
strerror
(
err
));
abort
();
}
}
static
void
*
...
...
src/pkg/runtime/cgo/freebsd_amd64.c
View file @
a026d0fc
...
...
@@ -20,11 +20,16 @@ libcgo_sys_thread_start(ThreadStart *ts)
pthread_attr_t
attr
;
pthread_t
p
;
size_t
size
;
int
err
;
pthread_attr_init
(
&
attr
);
pthread_attr_getstacksize
(
&
attr
,
&
size
);
ts
->
g
->
stackguard
=
size
;
pthread_create
(
&
p
,
&
attr
,
threadentry
,
ts
);
err
=
pthread_create
(
&
p
,
&
attr
,
threadentry
,
ts
);
if
(
err
!=
0
)
{
fprintf
(
stderr
,
"runtime/cgo: pthread_create failed: %s
\n
"
,
strerror
(
err
));
abort
();
}
}
static
void
*
...
...
src/pkg/runtime/cgo/linux_386.c
View file @
a026d0fc
...
...
@@ -21,6 +21,7 @@ libcgo_sys_thread_start(ThreadStart *ts)
pthread_attr_t
attr
;
pthread_t
p
;
size_t
size
;
int
err
;
// Not sure why the memset is necessary here,
// but without it, we get a bogus stack size
...
...
@@ -30,7 +31,11 @@ libcgo_sys_thread_start(ThreadStart *ts)
size
=
0
;
pthread_attr_getstacksize
(
&
attr
,
&
size
);
ts
->
g
->
stackguard
=
size
;
pthread_create
(
&
p
,
&
attr
,
threadentry
,
ts
);
err
=
pthread_create
(
&
p
,
&
attr
,
threadentry
,
ts
);
if
(
err
!=
0
)
{
fprintf
(
stderr
,
"runtime/cgo: pthread_create failed: %s
\n
"
,
strerror
(
err
));
abort
();
}
}
static
void
*
...
...
src/pkg/runtime/cgo/linux_amd64.c
View file @
a026d0fc
...
...
@@ -20,11 +20,16 @@ libcgo_sys_thread_start(ThreadStart *ts)
pthread_attr_t
attr
;
pthread_t
p
;
size_t
size
;
int
err
;
pthread_attr_init
(
&
attr
);
pthread_attr_getstacksize
(
&
attr
,
&
size
);
ts
->
g
->
stackguard
=
size
;
pthread_create
(
&
p
,
&
attr
,
threadentry
,
ts
);
err
=
pthread_create
(
&
p
,
&
attr
,
threadentry
,
ts
);
if
(
err
!=
0
)
{
fprintf
(
stderr
,
"runtime/cgo: pthread_create failed: %s
\n
"
,
strerror
(
err
));
abort
();
}
}
static
void
*
...
...
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