Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
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
张蕾
Geth-Modification
Commits
09e53367
Commit
09e53367
authored
Feb 15, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use a mutex write-lock for a write operation
parent
b143dad5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
server.go
p2p/server.go
+4
-4
packages.go
rpc/packages.go
+4
-4
No files found.
p2p/server.go
View file @
09e53367
...
...
@@ -436,15 +436,15 @@ func (self *BlacklistMap) Exists(pubkey []byte) (ok bool) {
}
func
(
self
*
BlacklistMap
)
Put
(
pubkey
[]
byte
)
error
{
self
.
lock
.
R
Lock
()
defer
self
.
lock
.
R
Unlock
()
self
.
lock
.
Lock
()
defer
self
.
lock
.
Unlock
()
self
.
blacklist
[
string
(
pubkey
)]
=
true
return
nil
}
func
(
self
*
BlacklistMap
)
Delete
(
pubkey
[]
byte
)
error
{
self
.
lock
.
R
Lock
()
defer
self
.
lock
.
R
Unlock
()
self
.
lock
.
Lock
()
defer
self
.
lock
.
Unlock
()
delete
(
self
.
blacklist
,
string
(
pubkey
))
return
nil
}
rpc/packages.go
View file @
09e53367
...
...
@@ -109,8 +109,8 @@ func (self *EthereumApi) NewFilterString(args string, reply *interface{}) error
}
func
(
self
*
EthereumApi
)
FilterChanged
(
id
int
,
reply
*
interface
{})
error
{
self
.
logMut
.
R
Lock
()
defer
self
.
logMut
.
R
Unlock
()
self
.
logMut
.
Lock
()
defer
self
.
logMut
.
Unlock
()
*
reply
=
toLogs
(
self
.
logs
[
id
])
...
...
@@ -309,8 +309,8 @@ func (p *EthereumApi) NewWhisperFilter(args *xeth.Options, reply *interface{}) e
}
func
(
self
*
EthereumApi
)
MessagesChanged
(
id
int
,
reply
*
interface
{})
error
{
self
.
messagesMut
.
R
Lock
()
defer
self
.
messagesMut
.
R
Unlock
()
self
.
messagesMut
.
Lock
()
defer
self
.
messagesMut
.
Unlock
()
*
reply
=
self
.
messages
[
id
]
...
...
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