There is a discussion on the occurrence of concurrentmodifcationexception at
How To Avoid ConcurrentModificationException.
To simulate that discussion, you can force the error to occur by adding to "o" inside the loop.
This may be what is occurring via another thread.
For further debugging, you could modify the "add" function in a class derived from linkedlist to print the time/thread name of the addition. Then, also print the time / thread name at the start and end of your loop. Or, if you only add to "o" in a small number of locations, just print the time/thread at each add.
Some potential trivial fixes include
1) In drawPerson, copy the list to an array inside a sychronized block, sychronized on "o", and then iterate over the array instead of iterating over the list.
2) or, during creation of "o" synchronize the list via
see
linkedList.
3) You could live with the error, just think what you want to do after catching the exception in the code inside the drawPerson function. Possibly you recall the member function from the catch block, a finite number of times to prevent a race/trap condition, and if the finite number of times is exceeded, just give up or throw an exception... I don't think this is a good recommendation, but may lead you to think of an appropriate action to take when the exception is caught.
4) Put the loop inside a block that is synchronized on "o".
You might investigate further about why synchronizing the function did not correct the error, printing time/thread when drawPerson is called, along with printing modifications to "o", with/without synchronized function.
Good luck
John