Hi guys, hope you can give me a few ideas where to look to solve this problem:
I have a component that recieves a message.
I have an executor with a method execute() that is called by part of a framework. The execute method waits until the component recieves a message and notifies listeners (eg the executor).
I'm trying to then get the component to wait until the Executor has finished with the message.
Ive tried to use a second wait/notify but i get a race condition, being notified before waiting etc.
Currently im using a rather rubbishy spinlock checking if the executor has finished every 10ms.
I can make changes to the component and the executor but i cant access other parts of the framework im working in
.
I assume i need some kind of lock so that each section of code is executed in the sequence described. Do you think some kind of control sequence object would assist?
help!
Tom