linux-2.6.33/mutex_lock()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#e960ad50]
#backlinks
*説明 [#j5806e48]
-パス: 複数あり
--CONFIG_DEBUG_LOCK_ALLOC 有効: [[linux-2.6.33/include/li...
--CONFIG_DEBUG_LOCK_ALLOC 無効: [[linux-2.6.33/kernel/mut...
-FIXME: これは何?
--説明
**引数 [#sf5da1d0]
-struct mutex *lock
--
--[[linux-2.6.33/mutex]]
**返り値 [#lae8a7c2]
-なし
**参考 [#yc2d0fc4]
*実装 [#uf432457]
**include/linux/mutex.h [#q37b1f0c]
#ifdef CONFIG_DEBUG_LOCK_ALLOC
-
--[[linux-2.6.33/CONFIG_DEBUG_LOCK_ALLOC]]
#define mutex_lock(lock) mutex_lock_nested(lock, 0)
(略)
-
--[[linux-2.6.33/mutex_lock_nested()]]
#else
-
extern void mutex_lock(struct mutex *lock);
(略)
-
#endif
**kernel/mutex.c [#s707b57f]
/***
* mutex_lock - acquire the mutex
* @lock: the mutex to be acquired
*
* Lock the mutex exclusively for this task. If the mute...
* available right now, it will sleep until it can get it.
*
* The mutex must later on be released by the same task ...
* acquired it. Recursive locking is not allowed. The task
* may not exit without first unlocking the mutex. Also,...
* memory where the mutex resides mutex must not be free...
* the mutex still locked. The mutex must first be initi...
* (or statically defined) before it can be locked. mems...
* the mutex to 0 is not allowed.
*
* ( The CONFIG_DEBUG_MUTEXES .config option turns on de...
* checks that will enforce the restrictions and will ...
* deadlock debugging. )
*
* This function is similar to (but not equivalent to) d...
*/
void __sched mutex_lock(struct mutex *lock)
{
might_sleep();
-
--[[linux-2.6.33/might_sleep()]]
/*
* The locking fastpath is the 1->0 transition from
* 'unlocked' into 'locked' state.
*/
__mutex_fastpath_lock(&lock->count, __mutex_lock_slowpa...
-高速にロックカウントを減らして、ミューテックスをロック状...
--[[linux-2.6.33/__mutex_fastpath_lock()]]
-既にロックされていたら __mutex_lock_slowpath でロック状...
--[[linux-2.6.33/__mutex_lock_slowpath()]]
mutex_set_owner(lock);
-現在実行中のタスクをミューテックスの所有者に設定する。
--[[linux-2.6.33/mutex_set_owner()]]
}
EXPORT_SYMBOL(mutex_lock);
-特にライセンスの区別なくシンボルを公開する。
--[[linux-2.6.33/EXPORT_SYMBOL()]]
*コメント [#u5b0e2fb]
終了行:
*参照元 [#e960ad50]
#backlinks
*説明 [#j5806e48]
-パス: 複数あり
--CONFIG_DEBUG_LOCK_ALLOC 有効: [[linux-2.6.33/include/li...
--CONFIG_DEBUG_LOCK_ALLOC 無効: [[linux-2.6.33/kernel/mut...
-FIXME: これは何?
--説明
**引数 [#sf5da1d0]
-struct mutex *lock
--
--[[linux-2.6.33/mutex]]
**返り値 [#lae8a7c2]
-なし
**参考 [#yc2d0fc4]
*実装 [#uf432457]
**include/linux/mutex.h [#q37b1f0c]
#ifdef CONFIG_DEBUG_LOCK_ALLOC
-
--[[linux-2.6.33/CONFIG_DEBUG_LOCK_ALLOC]]
#define mutex_lock(lock) mutex_lock_nested(lock, 0)
(略)
-
--[[linux-2.6.33/mutex_lock_nested()]]
#else
-
extern void mutex_lock(struct mutex *lock);
(略)
-
#endif
**kernel/mutex.c [#s707b57f]
/***
* mutex_lock - acquire the mutex
* @lock: the mutex to be acquired
*
* Lock the mutex exclusively for this task. If the mute...
* available right now, it will sleep until it can get it.
*
* The mutex must later on be released by the same task ...
* acquired it. Recursive locking is not allowed. The task
* may not exit without first unlocking the mutex. Also,...
* memory where the mutex resides mutex must not be free...
* the mutex still locked. The mutex must first be initi...
* (or statically defined) before it can be locked. mems...
* the mutex to 0 is not allowed.
*
* ( The CONFIG_DEBUG_MUTEXES .config option turns on de...
* checks that will enforce the restrictions and will ...
* deadlock debugging. )
*
* This function is similar to (but not equivalent to) d...
*/
void __sched mutex_lock(struct mutex *lock)
{
might_sleep();
-
--[[linux-2.6.33/might_sleep()]]
/*
* The locking fastpath is the 1->0 transition from
* 'unlocked' into 'locked' state.
*/
__mutex_fastpath_lock(&lock->count, __mutex_lock_slowpa...
-高速にロックカウントを減らして、ミューテックスをロック状...
--[[linux-2.6.33/__mutex_fastpath_lock()]]
-既にロックされていたら __mutex_lock_slowpath でロック状...
--[[linux-2.6.33/__mutex_lock_slowpath()]]
mutex_set_owner(lock);
-現在実行中のタスクをミューテックスの所有者に設定する。
--[[linux-2.6.33/mutex_set_owner()]]
}
EXPORT_SYMBOL(mutex_lock);
-特にライセンスの区別なくシンボルを公開する。
--[[linux-2.6.33/EXPORT_SYMBOL()]]
*コメント [#u5b0e2fb]
ページ名: