File tree Expand file tree Collapse file tree 7 files changed +10
-13
lines changed
main/java/io/reactivex/internal/schedulers
test/java/io/reactivex/schedulers Expand file tree Collapse file tree 7 files changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ public final class ComputationScheduler extends Scheduler {
30
30
/** This will indicate no pool is active. */
31
31
static final FixedSchedulerPool NONE = new FixedSchedulerPool (0 );
32
32
/** Manages a fixed number of workers. */
33
- private static final String THREAD_NAME_PREFIX = "RxComputationThreadPool- " ;
33
+ private static final String THREAD_NAME_PREFIX = "RxComputationThreadPool" ;
34
34
private static final RxThreadFactory THREAD_FACTORY = new RxThreadFactory (THREAD_NAME_PREFIX );
35
35
/**
36
36
* Key to setting the maximum number of computation scheduler threads.
@@ -55,7 +55,7 @@ public final class ComputationScheduler extends Scheduler {
55
55
}
56
56
MAX_THREADS = max ;
57
57
58
- SHUTDOWN_WORKER = new PoolWorker (new RxThreadFactory ("RxComputationShutdown- " ));
58
+ SHUTDOWN_WORKER = new PoolWorker (new RxThreadFactory ("RxComputationShutdown" ));
59
59
SHUTDOWN_WORKER .dispose ();
60
60
}
61
61
Original file line number Diff line number Diff line change 28
28
* Scheduler that creates and caches a set of thread pools and reuses them if possible.
29
29
*/
30
30
public final class IoScheduler extends Scheduler {
31
- private static final String WORKER_THREAD_NAME_PREFIX = "RxCachedThreadScheduler- " ;
31
+ private static final String WORKER_THREAD_NAME_PREFIX = "RxCachedThreadScheduler" ;
32
32
private static final RxThreadFactory WORKER_THREAD_FACTORY =
33
33
new RxThreadFactory (WORKER_THREAD_NAME_PREFIX );
34
34
35
- private static final String EVICTOR_THREAD_NAME_PREFIX = "RxCachedWorkerPoolEvictor- " ;
35
+ private static final String EVICTOR_THREAD_NAME_PREFIX = "RxCachedWorkerPoolEvictor" ;
36
36
private static final RxThreadFactory EVICTOR_THREAD_FACTORY =
37
37
new RxThreadFactory (EVICTOR_THREAD_NAME_PREFIX );
38
38
@@ -47,7 +47,7 @@ public final class IoScheduler extends Scheduler {
47
47
NONE = new CachedWorkerPool (0 , null );
48
48
NONE .shutdown ();
49
49
50
- SHUTDOWN_THREADWORKER = new ThreadWorker (new RxThreadFactory ("RxCachedThreadSchedulerShutdown- " ));
50
+ SHUTDOWN_THREADWORKER = new ThreadWorker (new RxThreadFactory ("RxCachedThreadSchedulerShutdown" ));
51
51
SHUTDOWN_THREADWORKER .dispose ();
52
52
}
53
53
Original file line number Diff line number Diff line change 23
23
*/
24
24
public final class NewThreadScheduler extends Scheduler {
25
25
26
- private static final String THREAD_NAME_PREFIX = "RxNewThreadScheduler- " ;
26
+ private static final String THREAD_NAME_PREFIX = "RxNewThreadScheduler" ;
27
27
private static final RxThreadFactory THREAD_FACTORY = new RxThreadFactory (THREAD_NAME_PREFIX );
28
28
private static final NewThreadScheduler INSTANCE = new NewThreadScheduler ();
29
29
Original file line number Diff line number Diff line change @@ -30,10 +30,7 @@ public RxThreadFactory(String prefix) {
30
30
31
31
@ Override
32
32
public Thread newThread (Runnable r ) {
33
- StringBuilder nameBuilder = new StringBuilder ();
34
- nameBuilder .append (prefix )
35
- .append ('-' )
36
- .append (incrementAndGet ());
33
+ StringBuilder nameBuilder = new StringBuilder (prefix ).append ('-' ).append (incrementAndGet ());
37
34
38
35
if (CREATE_TRACE ) {
39
36
nameBuilder .append ("\r \n " );
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ public static void start() {
58
58
if (curr != null && !curr .isShutdown ()) {
59
59
return ;
60
60
}
61
- ScheduledExecutorService next = Executors .newScheduledThreadPool (1 , new RxThreadFactory ("RxSchedulerPurge- " ));
61
+ ScheduledExecutorService next = Executors .newScheduledThreadPool (1 , new RxThreadFactory ("RxSchedulerPurge" ));
62
62
if (PURGE_THREAD .compareAndSet (curr , next )) {
63
63
64
64
next .scheduleAtFixedRate (new Runnable () {
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ public SingleScheduler() {
35
35
}
36
36
37
37
static ScheduledExecutorService createExecutor () {
38
- return SchedulerPoolFactory .create (new RxThreadFactory ("RxSingleScheduler- " ));
38
+ return SchedulerPoolFactory .create (new RxThreadFactory ("RxSingleScheduler" ));
39
39
}
40
40
41
41
@ Override
Original file line number Diff line number Diff line change 37
37
38
38
public class ExecutorSchedulerTest extends AbstractSchedulerConcurrencyTests {
39
39
40
- final static Executor executor = Executors .newFixedThreadPool (2 , new RxThreadFactory ("TestCustomPool- " ));
40
+ final static Executor executor = Executors .newFixedThreadPool (2 , new RxThreadFactory ("TestCustomPool" ));
41
41
42
42
@ Override
43
43
protected Scheduler getScheduler () {
You can’t perform that action at this time.
0 commit comments