concurrency, mutex, lock. Draft

Source: Internet
Author: User

Mutex class

A mutex is a lockable object that's designed to signal when critical sections of code need exclusive access, preventing O ther threads with the same protection from executing concurrently and access the same memory locations.

mutexobjects provide exclusive ownership and do no support recursivity (i.e., a thread shall not lock a mutex it already owns) -See for a recursive_mutex alternative class that does.

It's guaranteed to be a standard-layout class.

Member types
member Type Description
native_handle_type Type returned by native_handle (defined if library implementation supports it)

Member functions
(constructor)
Construct Mutex (public member function)
Lock
Lock Mutex (public member function)
Try_lock
Lock Mutex if not locked (public member function)
Unlock
Unlock Mutex (public member function)
Native_handle
Get Native handle (public member function)

concurrency, mutex, lock. Draft

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.