| Author |
Excercise 9-2
|
Glen Iris
Ranch Hand
Joined: Jul 13, 2011
Posts: 157
|
|
I am trying to synchronize a block of code as detailed on page 738/739.
I cannot figure out how to access the String that I pass to my MyThreaddy method on lines 9,10 and 11 of the below code.
I wish to access the letters 'a','b' or 'c', depending on the thread on line 33/34.
I hope somebody can help me. Thank you :-)
|
OCPJP 6, OCMJD (2/3)
|
 |
Henry Wong
author
Sheriff
Joined: Sep 28, 2004
Posts: 16687
|
|
Glen Iris wrote:I am trying to synchronize a block of code as detailed on page 738/739.
I cannot figure out how to access the String that I pass to my MyThreaddy method on lines 9,10 and 11 of the below code.
I wish to access the letters 'a','b' or 'c', depending on the thread on line 33/34.
I hope somebody can help me. Thank you :-)
The second parameter to the constructor (in lines 9, 10, and 11) is for the name of the thread ... which you changed in line 13, 14,and 15.
Henry
|
Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
|
 |
Glen Iris
Ranch Hand
Joined: Jul 13, 2011
Posts: 157
|
|
|
Thank you Henry.
|
 |
 |
|
|
subject: Excercise 9-2
|
|
|