Opened 8 years ago

Last modified 8 years ago

#11119 closed Bugs

mutex::lock must not throw — at Version 1

Reported by: viboes Owned by: viboes
Milestone: Boost 1.58.0 Component: thread
Version: Boost 1.57.0 Severity: Problem
Keywords: Cc:

Description (last modified by viboes)

The Mutex requirements say

m.unlock();

Requires:

    The current thread owns m. 
Synchronization:

    This operation synchronizes with subsequent lock operations that obtain ownership on the same object. 
Effects:

    Releases a lock on m by the current thread. 
Return type:

    void. 
Throws:

    Nothing. 

However mutex::unlock throws an exception.

void unlock()
{
    int res = posix::pthread_mutex_unlock(&m);
    if (res)
    {
        boost::throw_exception(lock_error(res,"boost: mutex unlock failed in pthread_mutex_unlock"));
    }
}

Change History (1)

comment:1 by viboes, 8 years ago

Description: modified (diff)
Owner: changed from Anthony Williams to viboes
Status: newassigned
Note: See TracTickets for help on using tickets.