| 749 | } |
| 750 | |
| 751 | Result Release(HCache cache, const char* uri, const char* etag, FILE* file) |
| 752 | { |
| 753 | dmMutex::ScopedLock lock(cache->m_Mutex); |
| 754 | |
| 755 | HashState64 hash_state; |
| 756 | dmHashInit64(&hash_state, false); |
| 757 | dmHashUpdateBuffer64(&hash_state, uri, strlen(uri)); |
| 758 | dmHashUpdateBuffer64(&hash_state, etag, strlen(etag)); |
| 759 | uint64_t identifier_hash = dmHashFinal64(&hash_state); |
| 760 | |
| 761 | uint64_t uri_hash = dmHashString64(uri); |
| 762 | Entry* entry = cache->m_CacheTable.Get(uri_hash); |
| 763 | assert(entry); |
| 764 | assert(entry->m_Info.m_IdentifierHash == identifier_hash); |
| 765 | assert(strcmp(uri, entry->m_Info.m_URI) == 0); |
| 766 | assert(entry->m_ReadLockCount > 0); |
| 767 | --entry->m_ReadLockCount; |
| 768 | |
| 769 | fclose(file); |
| 770 | return RESULT_OK; |
| 771 | } |
| 772 | |
| 773 | uint32_t GetEntryCount(HCache cache) |
| 774 | { |