Skip to content

Commit

Permalink
Protect NetworkImpl#close from concurrency issues (testcontainers#2203
Browse files Browse the repository at this point in the history
)

* Increase thread safety of NetworkImpl

* un-volatile `id`

Co-authored-by: Sergei Egorov <bsideup@gmail.com>
  • Loading branch information
2 people authored and quincy committed May 28, 2020
1 parent 4600cdd commit f278467
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -97,7 +97,7 @@ protected void after() {
}

@Override
public void close() {
public synchronized void close() {
if (initialized.getAndSet(false)) {
ResourceReaper.instance().removeNetworkById(id);
}
Expand Down

0 comments on commit f278467

Please sign in to comment.