Skip to content

Commit ea588fd

Browse files
committed
Cosmetic fixes.
1 parent d1e3847 commit ea588fd

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/main/java/org/jsl/collider/ThreadPool.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void run()
5959
int cc = m_contentionFactor;
6060
for (;;)
6161
{
62-
final Runnable runnable = getNext( idx );
62+
final Runnable runnable = getNext(idx);
6363
if (runnable == null)
6464
{
6565
if (--cc == 0)
@@ -105,7 +105,7 @@ public void run()
105105
}
106106

107107
if (s_logger.isLoggable(Level.FINE))
108-
s_logger.log( Level.FINE, name + ": finished (" + parks + " parks)." );
108+
s_logger.log(Level.FINE, name + ": finished (" + parks + " parks).");
109109
}
110110
}
111111

@@ -131,13 +131,13 @@ private Runnable getNext( int idx )
131131
{
132132
if (runnable.nextThreadPoolRunnable == null)
133133
{
134-
m_hra.set( idx, null );
134+
m_hra.set(idx, null);
135135
if (m_tra.compareAndSet(idx, runnable, null))
136136
return runnable;
137137
while (runnable.nextThreadPoolRunnable == null);
138138
}
139-
m_hra.set( idx, runnable.nextThreadPoolRunnable );
140-
s_nextUpdater.lazySet( runnable, null );
139+
m_hra.set(idx, runnable.nextThreadPoolRunnable);
140+
s_nextUpdater.lazySet(runnable, null);
141141
return runnable;
142142
}
143143
}
@@ -219,12 +219,12 @@ public void start()
219219

220220
public void stopAndWait() throws InterruptedException
221221
{
222-
assert( m_thread != null );
222+
assert(m_thread != null);
223223

224224
for (;;)
225225
{
226-
final int state = s_stateUpdater.get( this );
227-
assert( (state & STATE_STOP) == 0 );
226+
final int state = s_stateUpdater.get(this);
227+
assert((state & STATE_STOP) == 0);
228228
if (s_stateUpdater.compareAndSet(this, state, state|STATE_STOP))
229229
break;
230230
}
@@ -239,7 +239,7 @@ public void stopAndWait() throws InterruptedException
239239
break;
240240
if (s_stateUpdater.compareAndSet(this, state, state^workerId))
241241
{
242-
LockSupport.unpark( m_thread[idx] );
242+
LockSupport.unpark(m_thread[idx]);
243243
break;
244244
}
245245
}
@@ -252,22 +252,22 @@ public void stopAndWait() throws InterruptedException
252252
}
253253
}
254254

255-
public final void execute( Runnable runnable )
255+
public final void execute(Runnable runnable)
256256
{
257-
assert( runnable.nextThreadPoolRunnable == null );
257+
assert(runnable.nextThreadPoolRunnable == null);
258258

259259
int idx = (int) Thread.currentThread().getId();
260260
idx = (idx % m_contentionFactor) * FS_PADDING + FS_PADDING - 1;
261261

262-
final Runnable tail = m_tra.getAndSet( idx, runnable );
262+
final Runnable tail = m_tra.getAndSet(idx, runnable);
263263
if (tail == null)
264-
m_hra.set( idx, runnable );
264+
m_hra.set(idx, runnable);
265265
else
266266
tail.nextThreadPoolRunnable = runnable;
267267

268268
for (;;)
269269
{
270-
final int state = s_stateUpdater.get( this );
270+
final int state = s_stateUpdater.get(this);
271271
if ((state & IDLE_THREADS_MASK) == 0)
272272
{
273273
if ((state & STATE_SPIN) != 0)
@@ -294,7 +294,7 @@ public final void execute( Runnable runnable )
294294
final int newState = (state ^ (1 << workerIdx));
295295
if (s_stateUpdater.compareAndSet(this, state, newState))
296296
{
297-
LockSupport.unpark( m_thread[workerIdx] );
297+
LockSupport.unpark(m_thread[workerIdx]);
298298
break;
299299
}
300300
}

0 commit comments

Comments
 (0)