Skip to content

MutexDestroy

Description

Destroy the provided mutex object. Caller must pass the same allocator that was originally given to MutexCreate.

Parameters

Name Direction Description
m in Mutex object to be destroyed.
alloc in Allocator that originally allocated the mutex handle.

Success

Resources released.

Failure

Function cannot fail - safe to call with NULL mutex.

Usage example (Cross-references)

Usage examples (Cross-references)
    }
    
    void MutexDestroy(Mutex *m, Allocator *alloc) {
        if (!m) {
            return;
        }
        if (!alloc) {
            LOG_FATAL("MutexDestroy requires the allocator that created the mutex");
        }
    #ifdef _WIN32
    static void free_log_mutex(void) {
        if (log_mutex && log_persistent_alloc) {
            MutexDestroy(log_mutex, log_persistent_alloc);
            log_mutex = NULL;
        }
Last updated on