Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/ignite-sprint-4' into ig…
Browse files Browse the repository at this point in the history
…nite-758

Conflicts:
	modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheGateway.java
	modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
  • Loading branch information
ivasilinets committed Apr 17, 2015
1 parent 960b0a3 commit e3e263b
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 90 deletions.
Expand Up @@ -120,10 +120,10 @@ public void leave() {
}

/**
* @param prj Projection to guard.
* @return Previous projection set on this thread.
* @param opCtx Cache operation context to guard.
* @return Previous operation context set on this thread.
*/
@Nullable public CacheOperationContext enter(@Nullable CacheOperationContext prj) {
@Nullable public CacheOperationContext enter(@Nullable CacheOperationContext opCtx) {
try {
GridCacheAdapter<K, V> cache = ctx.cache();

Expand Down Expand Up @@ -153,7 +153,7 @@ public void leave() {
// Must unlock in case of unexpected errors to avoid
// deadlocks during kernal stop.
try {
return setProjectionPerCall(prj);
return setOperationContextPerCall(opCtx);
}
catch (RuntimeException e) {
rwLock.readUnlock();
Expand All @@ -163,29 +163,29 @@ public void leave() {
}

/**
* @param prj Projection to guard.
* @return Previous projection set on this thread.
* @param opCtx Operation context to guard.
* @return Previous operation context set on this thread.
*/
@Nullable public GridCacheProjectionImpl<K, V> enterNoLock(@Nullable GridCacheProjectionImpl<K, V> prj) {
@Nullable public CacheOperationContext enterNoLock(@Nullable CacheOperationContext opCtx) {
onEnter();

if (stopped)
throw new IllegalStateException("Cache has been stopped: " + ctx.name());

return setProjectionPerCall(prj);
return setOperationContextPerCall(opCtx);
}

/**
* Set thread local projection per call.
* Set thread local operation context per call.
*
* @param prj Projection to guard.
* @return Previous projection set on this thread.
* @param opCtx Operation context to guard.
* @return Previous operation context set on this thread.
*/
private CacheOperationContext setProjectionPerCall(@Nullable CacheOperationContext prj) {
private CacheOperationContext setOperationContextPerCall(@Nullable CacheOperationContext opCtx) {
CacheOperationContext prev = ctx.operationContextPerCall();

if (prev != null || prj != null)
ctx.operationContextPerCall(prj);
if (prev != null || opCtx != null)
ctx.operationContextPerCall(opCtx);

return prev;
}
Expand All @@ -212,7 +212,7 @@ public void leaveNoLock(CacheOperationContext prev) {
// Unwind eviction notifications.
CU.unwindEvicts(ctx);

// Return back previous thread local projection per call.
// Return back previous thread local operation context per call.
ctx.operationContextPerCall(prev);
}

Expand Down

0 comments on commit e3e263b

Please sign in to comment.