Function: finalize_reference
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
√ |
|
√ |
|
√ |
|
√ |
|
√ |
Description
Performs deinitialization to destroy the resources used by the acl API in the process.
acl.finalize_reference involves reference counting. Each time acl.init is called, the reference count increases by 1. Each time acl.finalize_reference is called, the reference count decreases by 1. Deinitialization is performed only when the reference count decreases to 0. The difference between the acl.finalize API and this API is that the acl.finalize API clears the count and directly performs deinitialization.
Prototype
- C Prototype
1aclError aclFinalizeReference(uint64_t *refCount)
- Python Function
1count, ret = acl.finalize_reference()
Parameters
None
Return Value
Return Value |
Description |
|---|---|
count |
Int, reference count. |
ret |
Int, error code. 0 on success; else, failure. |
Restrictions
Before exiting the application process, ensure that acl.finalize or acl.finalize_reference has been called to complete deinitialization. Otherwise, an exception may occur. For example, an error is reported when the application process exits.
You are advised not to call the acl.finalize or acl.finalize_reference API in the destructor. Otherwise, the process may exit abnormally due to the unknown singleton destructor sequence.