File tree 1 file changed +5
-7
lines changed
src/main/java/io/lettuce/core/protocol
1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -1266,25 +1266,23 @@ public void execute(Runnable task) {
1266
1266
cur = this .owner ;
1267
1267
if (isOwnerCurrentThreadAndPreemptPrevented (cur )) {
1268
1268
// already prevented preemption, safe to skip expensive add/done calls
1269
- executeInOwnerWithPreemptPrevention ( task , false );
1269
+ task . run ( );
1270
1270
return ;
1271
1271
}
1272
1272
} while (!OWNER .compareAndSet (this , cur , cur .toAdd (1 )));
1273
1273
1274
1274
if (cur .isCurrentThread ()) {
1275
- executeInOwnerWithPreemptPrevention (task , true );
1275
+ executeInOwnerWithPreemptPrevention (task );
1276
1276
} else {
1277
- cur .thread .execute (() -> executeInOwnerWithPreemptPrevention (task , true ));
1277
+ cur .thread .execute (() -> executeInOwnerWithPreemptPrevention (task ));
1278
1278
}
1279
1279
}
1280
1280
1281
- private void executeInOwnerWithPreemptPrevention (Runnable task , boolean added ) {
1281
+ private void executeInOwnerWithPreemptPrevention (Runnable task ) {
1282
1282
try {
1283
1283
task .run ();
1284
1284
} finally {
1285
- if (added ) {
1286
- done (1 );
1287
- }
1285
+ done (1 );
1288
1286
}
1289
1287
}
1290
1288
You can’t perform that action at this time.
0 commit comments