Function Report

Linux Kernel (v4.4)

Source File:ipc\sem.c Create Date:2016-01-14 13:10:09
Last Modify:2016-01-11 07:01:32 Copyright©Brick
home page Tree
Annotate the kernelChinese

Function Name:exit_sem

Function:void exit_sem(struct task_struct *tsk)

Return Type:void

Parameter:

Type Parameter NameRemarks
struct task_struct * tsk

Function description:add semadj values to semaphores, free undo structures.

2070  controls shared access to the list of sem_undo structures that may be shared among all a CLONE_SYSVSEM task group. = undo_list
2071  If !controls shared access to the list of sem_undo structures that may be shared among all a CLONE_SYSVSEM task group. then Returning
2073  undo_list = NULL
2075  If ! decrement and test then Returning
2078  For
2084  mark the beginning of an RCU read-side critical section
2086  Each task has a list of undo requests. They are executed automatically when the process exits. = get the struct for this entry
2096  Break.
2098  spin_lock( &controls shared access to the list of sem_undo structures that may be shared among all a CLONE_SYSVSEM task group.)
2099  semid = semaphore set identifier
2100  spin_unlock( &controls shared access to the list of sem_undo structures that may be shared among all a CLONE_SYSVSEM task group.)
2103  If semid == -1 then
2105  Continue.
2108  One sem_array data structure for each set of semaphores in the system. = sem_obtain_object_check(ipc_ns, semid)
2112  Continue.
2115  If the request contains only one semaphore operation, and there are no complex transactions pending, lock only the semaphore involved
2120  Continue.
2122  Each task has a list of undo requests. They are executed automatically when the process exits. = __lookup_undo(controls shared access to the list of sem_undo structures that may be shared among all a CLONE_SYSVSEM task group., semid)
2129  Continue.
2133  ipc_assert_locked_object( & permissions.. see ipc.h)
2134  list_del
2140  deletes entry from list without re-initialization
2145  If array of adjustments[i] then
2168  Initialization list head
2169  optimized update_queue
2170  sem_unlock(One sem_array data structure for each set of semaphores in the system., -1)
2171  marks the end of an RCU read-side critical section.
2172  do the actual wake-up
2174  kfree_rcu()- kfree an object after a grace period.
2176  kfree(controls shared access to the list of sem_undo structures that may be shared among all a CLONE_SYSVSEM task group.)
Caller
Function NameFunction description
copy_processCreate a new process
SYSC_unshare
do_exit
ipcns_install