java - Abort the function call if it running in multiple threads -


i setting sessiontimeout function in jsp page call other jsp page using iframe on click of button in other jsp page have sessiontimeout function. because of function running in parallel. can me if there way "if same function called multiple times in different threads should cancel other thread , access latest thread".

i have tried using synchronised method wont allow me use until function completed cant use synchronise

can me regarding this?

javascript running in different iframe not guaranteed run in same thread each browser engine implementation.

you might need build task management utility in parent window keep track of iframe instances , sessiontimeout function running state (keep state in array/map). since script inside parent , iframes single threaded in context, can check state of each iframe before fire sessiontimout function in iframes.

in case need cross-domain iframe communication, can read post @ http://www.codeproject.com/tips/585663/communication-with-cross-domain-iframe-a-cross-bro


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -