tibasSpace_CompareAndTakeAllEx()

Compares values in a list of specified values with the values in the existing tuples. If value matches are found, takes the specified tuples. Allows you to set lock and lock wait attributes for the tuples.

Declaration

tibas_status tibasSpace_CompareAndTakeAllEx(
    tibasSpace space,
    tibasSpaceResultList* resultList,
    tibasTupleList oldValueList,
    tibasTakeOptions options)

Parameters

Parameter Description
space The TIBCO ActiveSpaces entity on which the function is invoked.
resultList A list of the values in the space.
oldValueList A list of old values. If you specify NULL in a list item, only empty tuples are replaced.
options Provide a tibasTakeOptions structure that specifies the options for the take.

Remarks

Use the tibasSpace_CompareAndTakeAllEx() function to look for tuples containing specified values, and if value matches are found, take the tuple values. If there is no mismatch, the function returns the same value as specified in the list of old values.

tibasSpace_CompareAndTakeEx() also allows you to specify additional options for the operation, by passing a tibasTakeOptions structure in the options parameter. The tibasTakeOptions structure is defined as follows:

struct _tibasTakeOptions {
    tibas_long    lockWait;
    tibas_boolean lock;
    tibas_boolean unlock;
    tibas_boolean forget;
};

The take options are defined as follows:

lockWait
Specifies a lock wait time, in milliseconds.
lock
Take the data and lock the tuple.
unlock
Unlock the tuple. Only the thread or process that locked the tuple can unlock it.

Lock and unlock are mutually exclusive. If you use one of these, code NULL for the other.

forget
Specify this option if you want the system to forget the return. This is useful if you do not need the tuple.