![]() |
![]() |
![]() |
libInstPatch Reference Manual | ![]() |
---|---|---|---|---|
IpatchList; IpatchListClass; IpatchList* ipatch_list_new (void); IpatchList* ipatch_list_duplicate (IpatchList *list); void ipatch_list_init_iter (IpatchList *list, IpatchIter *iter);
Object lists are used to solve issues relating to multi-threading. A sensitive list will be locked and then duplicated and a reference added to each object in the list. The sensitive list can then be unlocked and the new duplicate list can be used without fear of multi-threading issues. The list and all object references are released once the IpatchList is destroyed. NOTE: If performance sensitive code is being written IPATCH_ITEM_RLOCK, IPATCH_ITEM_WLOCK and the IpatchIter functions should probably be used instead. Directly accessing item fields can also improve performance, although less likely to be backwards compatible in future versions.
IpatchList* ipatch_list_new (void);
Create a new object list object. IpatchList objects are often used to duplicate multi-thread sensitive object lists, so they can be iterated over at one's own leasure.
Returns : | New object list container object. |
IpatchList* ipatch_list_duplicate (IpatchList *list);
Duplicate an object list.
list : |
Object list to duplicate |
Returns : | New duplicate object list with a ref count of one which the caller owns. |
void ipatch_list_init_iter (IpatchList *list, IpatchIter *iter);
Initializes a user supplied iterator (usually stack allocated) to iterate
over the object list
. Further operations on iter
will use the list
.
list : |
List object |
iter : |
Iterator to initialize |