Hi, lapo,
I use schedule task as following:
mainExtension run a schedule task B_Extension, after B_Extension finish the task, call the mainExtension function: handleRequest(), the the following error happen.
jvm 1 | java.util.ConcurrentModificationException
jvm 1 | at java.util.LinkedList$ListItr.checkForComodification(Unknown Source)
jvm 1 | at java.util.LinkedList$ListItr.remove(Unknown Source)
jvm 1 | at it.gotoandplay.smartfoxserver.util.scheduling.Scheduler.executeTasks(Scheduler.java:327)
jvm 1 | at it.gotoandplay.smartfoxserver.util.scheduling.Scheduler.run(Scheduler.java:223)
jvm 1 | at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
jvm 1 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
jvm 1 | at java.lang.Thread.run(Unknown Source)
Pls inform how to solve, thanks.
jacky
Schedule Task Error
Re: Schedule Task Error
The problem is not with the Scheduler. You are modifying a LinkedList from two threads at the same time, which causes the data in the List to corrupt.
You will need to synchronize access between threads.
See here:
http://stackoverflow.com/questions/1241 ... linkedlist
You will need to synchronize access between threads.
See here:
http://stackoverflow.com/questions/1241 ... linkedlist
Return to “Server Side Extension Development”
Who is online
Users browsing this forum: No registered users and 35 guests