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
718da333
Commit
718da333
authored
Apr 29, 2010
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
darwin: bsdthread_create can fail; print good error
Fixes #549. R=adg CC=golang-dev
https://golang.org/cl/1019042
parent
7c77e450
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
6 deletions
+11
-6
sys.s
src/pkg/runtime/darwin/386/sys.s
+4
-2
sys.s
src/pkg/runtime/darwin/amd64/sys.s
+4
-2
os.h
src/pkg/runtime/darwin/os.h
+1
-1
thread.c
src/pkg/runtime/darwin/thread.c
+2
-1
No files found.
src/pkg/runtime/darwin/386/sys.s
View file @
718da333
...
@@ -130,8 +130,10 @@ TEXT bsdthread_create(SB),7,$32
...
@@ -130,8 +130,10 @@ TEXT bsdthread_create(SB),7,$32
MOVL BX, 16(SP) // pthread
MOVL BX, 16(SP) // pthread
MOVL $0x1000000, 20(SP) // flags = PTHREAD_START_CUSTOM
MOVL $0x1000000, 20(SP) // flags = PTHREAD_START_CUSTOM
INT $0x80
INT $0x80
JAE 2(PC)
JAE 3(PC)
CALL notok(SB)
MOVL $-1, AX
RET
MOVL $0, AX
RET
RET
// The thread that bsdthread_create creates starts executing here,
// The thread that bsdthread_create creates starts executing here,
...
...
src/pkg/runtime/darwin/amd64/sys.s
View file @
718da333
...
@@ -116,8 +116,10 @@ TEXT bsdthread_create(SB),7,$0
...
@@ -116,8 +116,10 @@ TEXT bsdthread_create(SB),7,$0
MOVQ $0, R9 // paranoia
MOVQ $0, R9 // paranoia
MOVQ $(0x2000000+360), AX // bsdthread_create
MOVQ $(0x2000000+360), AX // bsdthread_create
SYSCALL
SYSCALL
JCC 2(PC)
JCC 3(PC)
CALL notok(SB)
MOVL $-1, AX
RET
MOVL $0, AX
RET
RET
// The thread that bsdthread_create creates starts executing here,
// The thread that bsdthread_create creates starts executing here,
...
...
src/pkg/runtime/darwin/os.h
View file @
718da333
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// license that can be found in the LICENSE file.
void
bsdthread_create
(
void
*
,
M
*
,
G
*
,
void
(
*
)(
void
));
int32
bsdthread_create
(
void
*
,
M
*
,
G
*
,
void
(
*
)(
void
));
void
bsdthread_register
(
void
);
void
bsdthread_register
(
void
);
int32
mach_msg_trap
(
MachHeader
*
,
int32
,
uint32
,
uint32
,
uint32
,
uint32
,
uint32
);
int32
mach_msg_trap
(
MachHeader
*
,
int32
,
uint32
,
uint32
,
uint32
,
uint32
,
uint32
);
uint32
mach_reply_port
(
void
);
uint32
mach_reply_port
(
void
);
...
...
src/pkg/runtime/darwin/thread.c
View file @
718da333
...
@@ -157,7 +157,8 @@ newosproc(M *m, G *g, void *stk, void (*fn)(void))
...
@@ -157,7 +157,8 @@ newosproc(M *m, G *g, void *stk, void (*fn)(void))
printf
(
"newosproc stk=%p m=%p g=%p fn=%p id=%d/%d ostk=%p
\n
"
,
printf
(
"newosproc stk=%p m=%p g=%p fn=%p id=%d/%d ostk=%p
\n
"
,
stk
,
m
,
g
,
fn
,
m
->
id
,
m
->
tls
[
0
],
&
m
);
stk
,
m
,
g
,
fn
,
m
->
id
,
m
->
tls
[
0
],
&
m
);
}
}
bsdthread_create
(
stk
,
m
,
g
,
fn
);
if
(
bsdthread_create
(
stk
,
m
,
g
,
fn
)
<
0
)
throw
(
"cannot create new OS thread"
);
}
}
// Called to initialize a new m (including the bootstrap m).
// Called to initialize a new m (including the bootstrap m).
...
...
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