According to OtlTaskControl.pas
(based on v3.02 source), you can't exceed 64. (Don't know where your 60 came from, but I admit not having tried to exceed it.)
TOmniTaskGroup.WaitForAll
(approximately line #3300) uses the WinAPI function WaitForMultipleObjects
, and according to the MSDN documentation:
The maximum number of object handles is MAXIMUM_WAIT_OBJECTS.
MAXIMUM_WAIT_OBJECTS
is defined in Windows.pas
(for XE3, at approximately line # 1017:
MAXIMUM_WAIT_OBJECTS = 64;
{$EXTERNALSYM MAXIMUM_WAIT_OBJECTS}
The declaration itself comes from WinNT.h
from the SDK, which contains:
#define MAXIMUM_WAIT_OBJECTS 64 // Maximum number of wait objects
WaitForMultipleObjects
returns an error code if you pass it a value higher than MAXIMUM_WAIT_OBJECTS
as the nCount
parameter. (The error code is returned if any value higher than 64
is send as the nCount
parameter, which means this value is built into the implementation of the function itself.)
A quick review of the other API Multiple-object Wait Functions doesn't turn up anything else that will accept more than MAXIMUM_WAIT_OBJECTS
items, either.
So the specific answer to your question is: The only way this can be done is to write your own replacement for the WinAPI's WaitForMultipleObjects
, and then replace the WaitForMultipleObjects
call in TOmniTaskGroup.WaitForAll
with a call to your function instead. (That's a very massive undertaking, which is probably why it hasn't been done in OTL, and expecting someone to do it in an answer here would be pretty unrealistic.)