Skip to content

Commit 6f38106

Browse files
Update README.adoc
adoc corrections
1 parent 43561ae commit 6f38106

1 file changed

Lines changed: 15 additions & 10 deletions

File tree

README.adoc

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -128,28 +128,33 @@ In this example, the library will prefer a free CPU on the same Socket as the fi
128128

129129
=== Getting the thread id.
130130
You can get the current thread id using
131-
131+
[source, java]
132+
----
132133
int threadId = AffinitySupport.getThreadId();
133-
134+
----
134135
=== Determining which CPU you are running on.
135136
You can get the current CPU being used by
136-
137+
[source, java]
138+
----
137139
int cpuId = AffinitySupport.getCpu();
138-
140+
----
139141
=== Controlling the affinity more directly.
140142
The affinity of the process on start up is
141-
143+
[source, java]
144+
----
142145
long baseAffinity = AffinityLock.BASE_AFFINITY;
143-
146+
----
144147
The available CPU for reservation is
145-
148+
[source, java]
149+
----
146150
long reservedAffinity = AffinityLock.RESERVED_AFFINITY;
147-
151+
----
148152
If you want to get/set the affinity directly you can do
149-
153+
[source, java]
154+
----
150155
long currentAffinity = AffinitySupport.getAffinity();
151156
AffinitySupport.setAffinity(1L << 5); // lock to CPU 5.
152-
157+
----
153158
=== Debugging affinity state
154159

155160
For a detailed of view of the current affinity state (as seen by the library),

0 commit comments

Comments
 (0)