-
Notifications
You must be signed in to change notification settings - Fork 83
Description
I found the case when the promise is broken of OwnThread operations to be called in the thread safe way.
I have a task with sequential activity with OwnThread operations and event ports.
I found I can call OwnThread operations from task browser in the middle of update hook processing data from event port. I'd expect OwnThread operations to be serialized and called only after updateHook returned.
It's caused by SequentialActivity::thread() returning os::MainThread, so when operation is called from the main thread, OperationCallerInterface::isSend() returns false as the current thread matches activity thread even while activity is being triggered from another thread.
I don't know what would be the appropriate fix for this, OperationCallerInterface::isSend() should check the actual active sequential activity thread instead of the default MainThread, but I don't know how to do this in a thread safe way.
Another possible not very nice workarounds:
- use a dummy thread for sequential activities so it never matches calling thread
- OperationCallerInterface::isSend() should return true for OwnThread operations of main thread activities