Which choice is the most reasonable implementation of the function std::mutex::lock() by using std::mutex::try_lock()?

  • A
    void std::mutex::lock(){
    while(!this->try_lock());
    }
  • B
    void std::mutex::lock(){
    return (this->try_lock());
    }
  • C
    void std::mutex::lock(){
    while(1)
    this->try_lock();
    }
  • D
    void std::mutex::lock(){
    while(this->try_lock());
    }
Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Leave a Comment

Share via
Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Send this to a friend