cplusplus
.com
教程
參考
文章
論壇
C++
教程
參考
文章
論壇
參考
C 庫
<cassert> (assert.h)
<cctype> (ctype.h)
<cerrno> (errno.h)
C++11
<cfenv> (fenv.h)
<cfloat> (float.h)
C++11
<cinttypes> (inttypes.h)
<ciso646> (iso646.h)
<climits> (limits.h)
<clocale> (locale.h)
<cmath> (math.h)
<csetjmp> (setjmp.h)
<csignal> (signal.h)
<cstdarg> (stdarg.h)
C++11
<cstdbool> (stdbool.h)
<cstddef> (stddef.h)
C++11
<cstdint> (stdint.h)
<cstdio> (stdio.h)
<cstdlib> (stdlib.h)
<cstring> (string.h)
C++11
<ctgmath> (tgmath.h)
<ctime> (time.h)
C++11
<cuchar> (uchar.h)
<cwchar> (wchar.h)
<cwctype> (wctype.h)
容器
C++11
<array>
<deque>
C++11
<forward_list>
<list>
<map>
<queue>
<set>
<stack>
C++11
<unordered_map>
C++11
<unordered_set>
<vector>
輸入/輸出
<fstream>
<iomanip>
<ios>
<iosfwd>
<iostream>
<istream>
<ostream>
<sstream>
<streambuf>
多執行緒
C++11
<atomic>
C++11
<condition_variable>
C++11
<future>
C++11
<mutex>
C++11
<thread>
其他
<algorithm>
<bitset>
C++11
<chrono>
C++11
<codecvt>
<complex>
<exception>
<functional>
C++11
<initializer_list>
<iterator>
<limits>
<locale>
<memory>
<new>
<numeric>
C++11
<random>
C++11
<ratio>
C++11
<regex>
<stdexcept>
<string>
C++11
<system_error>
C++11
<tuple>
C++11
<type_traits>
C++11
<typeindex>
<typeinfo>
<utility>
<valarray>
多執行緒
C++11
BasicLockable
C++11
Lockable
C++11
TimedLockable
參考
BasicLockable
概念
BasicLockable
基本鎖型別
BasicLockable
Lockable
TimedLockable
一個
基本鎖
型別是支援
BasicLockable
型別,它支援
lock
和
unlock
。
型別
標準庫定義了以下
BasicLockable
型別
標頭檔案
型別
<mutex>
mutex
recursive_mutex
timed_mutex
recursive_timed_mutex
unique_lock
要求
如果以下表達式形式良好,則值
m
是
BasicLockable
型別
m.lock()
效果:
阻塞,直到可以為當前執行代理獲取鎖。 如果引發異常,則不應為當前執行代理獲取鎖。
m.unlock()
要求:
當前執行代理應持有
m
上的鎖。
效果:
釋放當前執行代理持有的
m
上的鎖。
丟擲:
無。
另見
Lockable
可鎖型別(互斥鎖型別)
(概念)
TimedLockable
定時可鎖型別
(概念)