tibasSpace_CompareAndTake()
Looks for a tuple containing a specified value, and if it is found, takes the tuple value.
Declaration
tibas_status tibasSpace_CompareAndTake( tibasSpace space, tibasTuple* value, tibasTuple oldValue)
Remarks
Use the tibasSpace_CompareAndTake() function to look for a tuple containing a specified value, and if it is found, take the existing data.
See Also
tibasSpace_CompareAndTakeEx(), tibasSpace_CompareAndTakeAll(), tibasSpace_CompareAndTakeAllEx()
Looks for a tuple containing a specified value, and if it is found, takes the tuple value. Allows you to set lock and lock wait attributes for the tuples.
Declaration
tibas_status tibasSpace_CompareAndTakeEx( tibasSpace space, tibasTuple* value, tibasTuple oldValue, tibasTakeOptions options)
Remarks
Use the tibasSpace_CompareAndTakeEx() function to look for a tuple containing a specified value, and if it is found, take the tuple with the specified value.
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.