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
a10d35a8
Commit
a10d35a8
authored
11 years ago
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libgo: Update to Go 1.2.1 release.
From-SVN: r208286
parent
8c92028e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
70 additions
and
12 deletions
+70
-12
libgo/MERGE
+1
-1
libgo/go/database/sql/sql.go
+2
-2
libgo/go/database/sql/sql_test.go
+23
-0
libgo/go/net/fd_windows.go
+40
-8
libgo/runtime/mgc0.c
+4
-1
No files found.
libgo/MERGE
View file @
a10d35a8
65bf677ab8d8
0ddbdc3c7ce2
The first line of this file holds the Mercurial revision number of the
last merge done from the master library sources.
This diff is collapsed.
Click to expand it.
libgo/go/database/sql/sql.go
View file @
a10d35a8
...
...
@@ -620,8 +620,8 @@ func (db *DB) conn() (*driverConn, error) {
}
// If db.maxOpen > 0 and the number of open connections is over the limit
//
or there are no free connection, then
make a request and wait.
if
db
.
maxOpen
>
0
&&
(
db
.
numOpen
>=
db
.
maxOpen
||
db
.
freeConn
.
Len
()
==
0
)
{
//
and there are no free connection,
make a request and wait.
if
db
.
maxOpen
>
0
&&
db
.
numOpen
>=
db
.
maxOpen
&&
db
.
freeConn
.
Len
()
==
0
{
// Make the connRequest channel. It's buffered so that the
// connectionOpener doesn't block while waiting for the req to be read.
ch
:=
make
(
chan
interface
{},
1
)
...
...
This diff is collapsed.
Click to expand it.
libgo/go/database/sql/sql_test.go
View file @
a10d35a8
...
...
@@ -1005,6 +1005,29 @@ func TestMaxOpenConns(t *testing.T) {
}
}
func
TestSingleOpenConn
(
t
*
testing
.
T
)
{
db
:=
newTestDB
(
t
,
"people"
)
defer
closeDB
(
t
,
db
)
db
.
SetMaxOpenConns
(
1
)
rows
,
err
:=
db
.
Query
(
"SELECT|people|name|"
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
if
err
=
rows
.
Close
();
err
!=
nil
{
t
.
Fatal
(
err
)
}
// shouldn't deadlock
rows
,
err
=
db
.
Query
(
"SELECT|people|name|"
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
if
err
=
rows
.
Close
();
err
!=
nil
{
t
.
Fatal
(
err
)
}
}
// golang.org/issue/5323
func
TestStmtCloseDeps
(
t
*
testing
.
T
)
{
if
testing
.
Short
()
{
...
...
This diff is collapsed.
Click to expand it.
libgo/go/net/fd_windows.go
View file @
a10d35a8
...
...
@@ -513,12 +513,7 @@ func (fd *netFD) WriteTo(buf []byte, sa syscall.Sockaddr) (int, error) {
})
}
func
(
fd
*
netFD
)
accept
(
toAddr
func
(
syscall
.
Sockaddr
)
Addr
)
(
*
netFD
,
error
)
{
if
err
:=
fd
.
readLock
();
err
!=
nil
{
return
nil
,
err
}
defer
fd
.
readUnlock
()
func
(
fd
*
netFD
)
acceptOne
(
toAddr
func
(
syscall
.
Sockaddr
)
Addr
,
rawsa
[]
syscall
.
RawSockaddrAny
,
o
*
operation
)
(
*
netFD
,
error
)
{
// Get new socket.
s
,
err
:=
sysSocket
(
fd
.
family
,
fd
.
sotype
,
0
)
if
err
!=
nil
{
...
...
@@ -537,9 +532,7 @@ func (fd *netFD) accept(toAddr func(syscall.Sockaddr) Addr) (*netFD, error) {
}
// Submit accept request.
o
:=
&
fd
.
rop
o
.
handle
=
s
var
rawsa
[
2
]
syscall
.
RawSockaddrAny
o
.
rsan
=
int32
(
unsafe
.
Sizeof
(
rawsa
[
0
]))
_
,
err
=
rsrv
.
ExecIO
(
o
,
"AcceptEx"
,
func
(
o
*
operation
)
error
{
return
syscall
.
AcceptEx
(
o
.
fd
.
sysfd
,
o
.
handle
,
(
*
byte
)(
unsafe
.
Pointer
(
&
rawsa
[
0
])),
0
,
uint32
(
o
.
rsan
),
uint32
(
o
.
rsan
),
&
o
.
qty
,
&
o
.
o
)
...
...
@@ -556,6 +549,45 @@ func (fd *netFD) accept(toAddr func(syscall.Sockaddr) Addr) (*netFD, error) {
return
nil
,
&
OpError
{
"Setsockopt"
,
fd
.
net
,
fd
.
laddr
,
err
}
}
return
netfd
,
nil
}
func
(
fd
*
netFD
)
accept
(
toAddr
func
(
syscall
.
Sockaddr
)
Addr
)
(
*
netFD
,
error
)
{
if
err
:=
fd
.
readLock
();
err
!=
nil
{
return
nil
,
err
}
defer
fd
.
readUnlock
()
o
:=
&
fd
.
rop
var
netfd
*
netFD
var
err
error
var
rawsa
[
2
]
syscall
.
RawSockaddrAny
for
{
netfd
,
err
=
fd
.
acceptOne
(
toAddr
,
rawsa
[
:
],
o
)
if
err
==
nil
{
break
}
// Sometimes we see WSAECONNRESET and ERROR_NETNAME_DELETED is
// returned here. These happen if connection reset is received
// before AcceptEx could complete. These errors relate to new
// connection, not to AcceptEx, so ignore broken connection and
// try AcceptEx again for more connections.
operr
,
ok
:=
err
.
(
*
OpError
)
if
!
ok
{
return
nil
,
err
}
errno
,
ok
:=
operr
.
Err
.
(
syscall
.
Errno
)
if
!
ok
{
return
nil
,
err
}
switch
errno
{
case
syscall
.
ERROR_NETNAME_DELETED
,
syscall
.
WSAECONNRESET
:
// ignore these and try again
default
:
return
nil
,
err
}
}
// Get local and peer addr out of AcceptEx buffer.
var
lrsa
,
rrsa
*
syscall
.
RawSockaddrAny
var
llen
,
rlen
int32
...
...
This diff is collapsed.
Click to expand it.
libgo/runtime/mgc0.c
View file @
a10d35a8
...
...
@@ -1770,6 +1770,8 @@ runtime_memorydump(void)
void
runtime_gchelper
(
void
)
{
uint32
nproc
;
gchelperstart
();
// parallel mark for over gc roots
...
...
@@ -1786,7 +1788,8 @@ runtime_gchelper(void)
runtime_parfordo
(
work
.
sweepfor
);
bufferList
[
runtime_m
()
->
helpgc
].
busy
=
0
;
if
(
runtime_xadd
(
&
work
.
ndone
,
+
1
)
==
work
.
nproc
-
1
)
nproc
=
work
.
nproc
;
// work.nproc can change right after we increment work.ndone
if
(
runtime_xadd
(
&
work
.
ndone
,
+
1
)
==
nproc
-
1
)
runtime_notewakeup
(
&
work
.
alldone
);
}
...
...
This diff is collapsed.
Click to expand it.
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