Toggle navigation
Toggle navigation
This project
Loading...
Sign in
홍길동
/
onos
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Yuta HIGUCHI
2014-10-28 22:40:01 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
72569d657152cee8ee733a5a5e0c3ed640a7b439
72569d65
1 parent
71fa493b
remove synchronized
Change-Id: I1a11e48d042797744a4ac834fd65f6417c700f57
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
core/store/dist/src/main/java/org/onlab/onos/store/core/impl/DistributedApplicationIdStore.java
core/store/dist/src/main/java/org/onlab/onos/store/core/impl/DistributedApplicationIdStore.java
View file @
72569d6
...
...
@@ -15,6 +15,8 @@
*/
package
org
.
onlab
.
onos
.
store
.
core
.
impl
;
import
static
org
.
apache
.
commons
.
lang3
.
concurrent
.
ConcurrentUtils
.
putIfAbsent
;
import
com.google.common.collect.ImmutableSet
;
import
com.hazelcast.core.EntryEvent
;
import
com.hazelcast.core.EntryListener
;
...
...
@@ -97,20 +99,19 @@ public class DistributedApplicationIdStore
return
appId
;
}
private
synchronized
void
primeAppIds
()
{
private
void
primeAppIds
()
{
for
(
DefaultApplicationId
appId
:
appIdsByName
.
values
())
{
appIds
.
put
(
appId
.
id
(),
appId
);
}
}
@Override
public
synchronized
ApplicationId
registerApplication
(
String
name
)
{
public
ApplicationId
registerApplication
(
String
name
)
{
DefaultApplicationId
appId
=
appIdsByName
.
get
(
name
);
if
(
appId
==
null
)
{
short
id
=
(
short
)
lastAppId
.
getAndIncrement
();
appId
=
new
DefaultApplicationId
(
id
,
name
);
appIds
.
put
(
id
,
appId
);
appIdsByName
.
put
(
name
,
appId
);
appId
=
putIfAbsent
(
appIdsByName
,
name
,
new
DefaultApplicationId
(
id
,
name
));
}
return
appId
;
}
...
...
Please
register
or
login
to post a comment