CmzSQuid / omnithreadlibrary

Automatically exported from code.google.com/p/omnithreadlibrary
0 stars 0 forks source link

IOmniTaskControl.ChainTo - ChainedTo task should be executed even if it was chained after primary task completion. #66

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
It is possible to chain to another task when the primary task is executing.
But if you do so, you can't be sure if ChainTo completed before the primary 
task has finished. This is a synchronization part, wich should not be exposed 
outside of IOmniTaskControl.

      taskControl:= CreateTask(...);
      taskControl.Schedule(OmniPool);
      taskControl.WaitFor(aTimeout);
      continuationTask:= CreateTask(...);
      taskControl.ChainTo(continuationTask, true);
      //continuationTask should always be executed

Original issue reported on code.google.com by jmbial...@gmail.com on 15 Jun 2014 at 7:56

GoogleCodeExporter commented 8 years ago
ChainTo was designed to be very simple way of chaining tasks _before_ they are 
executed.

Original comment by gabr42 on 15 Jun 2014 at 9:31

GoogleCodeExporter commented 8 years ago
Ok, so for the clarity reason, you should ensure that: otcParameters.IsLocked = 
false.
As it is done in CancelWith.

BTW: Do you plan to comment the interface part? Would you accept a patch with 
such a comments?

Original comment by jmbial...@gmail.com on 16 Jun 2014 at 6:54

GoogleCodeExporter commented 8 years ago
Checking IsLocked is good idea, I'll add that. (Or even you can do it.)

Sure, I'll accept a patch with comments and any other additions or fixes!

Original comment by gabr42 on 16 Jun 2014 at 6:58