On the selection of std::unique_lock and std::lock_guard in CPP11

when I see the conditional variables section of CPP11, I find that all conditional variables are used in conjunction with locks, but at this time they all use unique_lock instead of lock_guard,. Can you explain that?


seems to be because the existence of lock_guard itself is strongly related to mutex, that is to say, once lock_ lock_ exists, the mutex must be locked, while in the condition variable, there is a procedure to release the lock

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b30c74-2bd3b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b30c74-2bd3b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?