[google/guice] 6c8584: Add a default value and make it true for dagger & ...

10 views
Skip to first unread message

GitHub

unread,
Apr 21, 2015, 9:44:07 AM4/21/15
to google-g...@googlegroups.com
Branch: refs/heads/moe_writing_branch_from_156c8cc762fab971efb727c7ab107fa243be2fc9
Home: https://github.com/google/guice
Commit: 6c85843a85100c01992a1f3c6a16bb9270055d84
https://github.com/google/guice/commit/6c85843a85100c01992a1f3c6a16bb9270055d84
Author: sameb <sa...@google.com>
Date: 2015-04-21 (Tue, 21 Apr 2015)

Changed paths:
M extensions/multibindings/src/com/google/inject/multibindings/MapKey.java

Log Message:
-----------
Add a default value and make it true for dagger & guice MapKey.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=89998087


Commit: 5e6c93348c4250012801b6e41753789d760f06e4
https://github.com/google/guice/commit/5e6c93348c4250012801b6e41753789d760f06e4
Author: timofeyb <timo...@google.com>
Date: 2015-04-21 (Tue, 21 Apr 2015)

Changed paths:
M core/src/com/google/inject/internal/BindingProcessor.java
M core/src/com/google/inject/internal/BoundProviderFactory.java
M core/src/com/google/inject/internal/ConstructionContext.java
M core/src/com/google/inject/internal/ConstructorBindingImpl.java
M core/src/com/google/inject/internal/ConstructorInjector.java
A core/src/com/google/inject/internal/CycleDetectingLock.java
M core/src/com/google/inject/internal/DelegatingInvocationHandler.java
M core/src/com/google/inject/internal/Errors.java
M core/src/com/google/inject/internal/InheritingState.java
M core/src/com/google/inject/internal/InjectorImpl.java
M core/src/com/google/inject/internal/InternalContext.java
M core/src/com/google/inject/internal/InternalFactoryToInitializableAdapter.java
M core/src/com/google/inject/internal/ProvidedByInternalFactory.java
M core/src/com/google/inject/internal/ProviderInternalFactory.java
M core/src/com/google/inject/internal/Scoping.java
M core/src/com/google/inject/internal/SingletonScope.java
M core/src/com/google/inject/internal/State.java
M core/test/com/google/inject/ScopesTest.java
A core/test/com/google/inject/internal/CycleDetectingLockTest.java

Log Message:
-----------
Implement more granular locks for a Singleton scope in Guice.

Now when you can create two independent singletons using
the same injector in different threads.
This make it easy to create scopes creating singletons using
thread pools with all the concurrency being done by Guice.
As a nice side effect Singleton scope is no longer treated
specially in Guice codebase.

The obvious problem to solve is potential deadlocks:
A requires B, B requires C, C requires A where all are
singletons and all are created simultaneously.
It's impossible to detect this deadlock using information
within one thread, so we have to have a shared storage.

An idea is to have a map of creators' locks and a map
of which threads are waiting for other singletons to be created.
Using this information circular dependencies are trivially
discovered within O(N) where N is a number of concurrent threads.

Important to not that no other deadlock scenarios within
Guice code is introduced as Guice does not expose any
other scopes that can span several threads.

Now it would be possible for
client code to deadlock on itself with two lazy singletons
calling each other's providers during creation.
This is deemed as a non-issue as it is up to the client
to write a thread-safe code.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=91610630


Commit: 3809a8196b693145828edd349952a9c4975ec249
https://github.com/google/guice/commit/3809a8196b693145828edd349952a9c4975ec249
Author: cgruber <cgr...@google.com>
Date: 2015-04-21 (Tue, 21 Apr 2015)

Changed paths:
R extensions/dagger-adapter/lib/dagger-2.0-20150205.014011-14.jar
A extensions/dagger-adapter/lib/dagger-2.0.jar
M extensions/dagger-adapter/pom.xml

Log Message:
-----------
Update dagger-adapter to depend on dagger-2.0 (and swap in the up-to-date api jar for the ant build)
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=91679331


Compare: https://github.com/google/guice/compare/6986d188358d...3809a8196b69

GitHub

unread,
Apr 21, 2015, 2:14:44 PM4/21/15
to google-g...@googlegroups.com
Branch: refs/heads/master
Commit: e3f556653ce41ff4e133ab45029c261db9ca35f4
https://github.com/google/guice/commit/e3f556653ce41ff4e133ab45029c261db9ca35f4
Author: Sam Berlin <sbe...@gmail.com>
Date: 2015-04-21 (Tue, 21 Apr 2015)

Changed paths:
M core/src/com/google/inject/internal/BindingProcessor.java
M core/src/com/google/inject/internal/BoundProviderFactory.java
M core/src/com/google/inject/internal/ConstructionContext.java
M core/src/com/google/inject/internal/ConstructorBindingImpl.java
M core/src/com/google/inject/internal/ConstructorInjector.java
A core/src/com/google/inject/internal/CycleDetectingLock.java
M core/src/com/google/inject/internal/DelegatingInvocationHandler.java
M core/src/com/google/inject/internal/Errors.java
M core/src/com/google/inject/internal/InheritingState.java
M core/src/com/google/inject/internal/InjectorImpl.java
M core/src/com/google/inject/internal/InternalContext.java
M core/src/com/google/inject/internal/InternalFactoryToInitializableAdapter.java
M core/src/com/google/inject/internal/ProvidedByInternalFactory.java
M core/src/com/google/inject/internal/ProviderInternalFactory.java
M core/src/com/google/inject/internal/Scoping.java
M core/src/com/google/inject/internal/SingletonScope.java
M core/src/com/google/inject/internal/State.java
M core/test/com/google/inject/ScopesTest.java
A core/test/com/google/inject/internal/CycleDetectingLockTest.java
R extensions/dagger-adapter/lib/dagger-2.0-20150205.014011-14.jar
A extensions/dagger-adapter/lib/dagger-2.0.jar
M extensions/dagger-adapter/pom.xml
M extensions/multibindings/src/com/google/inject/multibindings/MapKey.java

Log Message:
-----------
Merge pull request #915 from google/moe_writing_branch_from_156c8cc762fab971efb727c7ab107fa243be2fc9

Merge internal changes


Compare: https://github.com/google/guice/compare/06669e797884...e3f556653ce4
Reply all
Reply to author
Forward
0 new messages